( left: Either.Either<Chunk.Chunk<A>, number>, right: Either.Either<Chunk.Chunk<A>, number> )
| 82 | * @since 2.0.0 |
| 83 | */ |
| 84 | export const compose = <A>( |
| 85 | left: Either.Either<Chunk.Chunk<A>, number>, |
| 86 | right: Either.Either<Chunk.Chunk<A>, number> |
| 87 | ): Either.Either<Chunk.Chunk<A>, number> => { |
| 88 | if (Either.isLeft(left) && Either.isLeft(right)) { |
| 89 | return Either.left(left.left + right.left) |
| 90 | } |
| 91 | if (Either.isRight(left) && Either.isRight(right)) { |
| 92 | return Either.right(pipe(left.right, Chunk.appendAll(right.right))) |
| 93 | } |
| 94 | if (Either.isRight(left) && Either.isLeft(right)) { |
| 95 | return right |
| 96 | } |
| 97 | if (Either.isLeft(left) && Either.isRight(right)) { |
| 98 | return right |
| 99 | } |
| 100 | throw new Error(getBugErrorMessage("TestAnnotation.compose")) |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * @since 2.0.0 |
nothing calls this directly
no test coverage detected