I am new to fp-ts. I am used to scala for comprehensions when dealing with combining Either, IO and ... The question is, let's say we have function with signatures
either(T): Either<Error, T>
ioEither(T): IOEither<Error, T>
taskEither(T): TaskEither<Error, T>
...
And I want to combine them, and I get something along the lines of
pipe(T, taskEither, map(either)): TaskEither<Error, Either<Error, T>>
Which should be flattened.
How to combine function of types T -> M<T>
where M is IO or Task, and T -> M<Error, T>
where M is Either, TaskEither or IOEither, flattening in process, like with scala for comprehensions?