Equivalent of Scala cats EitherT<IO, A, B> #1090
Replies: 3 comments
-
Hi @TangkasOka, I don't think you need a monad transformer over Aff. Aff bakes in an error channel, and with the latest beta release it supports applicative behavior and can be extended to support custom error types. I think it should meet all your requirements. If you have a particular use case that you need help with (coded in a functional scala style using cats), I am more than happy to have a go (as best I can) at solving using language ext. |
Beta Was this translation helpful? Give feedback.
-
C# doesn't have higher-kinds, so this just isn't possible. Any monad-transformer-like behaviour has to be built manually, either by creating a new type that wraps the composed monads (and then manually implementing If you're migrating a lot of code over from Scala, and you have a number of transformer stacks, then yes, it would make sense to wrap them in a new type and build the LINQ machinery for it. |
Beta Was this translation helpful? Give feedback.
-
Thanks both. I'll start by taking a look at using Aff with an error channel. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm porting some Scala code to .NET that uses the cats effect IO and cats data EitherT classes.
https://typelevel.org/cats-effect/docs/2.x/datatypes/io
https://typelevel.org/cats/datatypes/eithert.html
The IO is like the IO monad in Haskell in that it is for deferring actions with side effects to "the end of the world". I was thinking of replacing this with Aff.
The EitherT is an Either transformer that take a "highly kinded type" and two other types. I don't need a fully general version of this, just one specialized for Aff as the type to be transformed over.
I'm looking for suggestions on how to approach this.
Thanks,
Charlie
Beta Was this translation helpful? Give feedback.
All reactions