4 ms·
What Haskell did with Monads is nice, but eventually Monads are just tags on what functionality the function uses. That being said, I like that Nim and Koka di
by cleancoder0 5y ago
What Haskell did with Monads is nice, but eventually Monads are just tags on what functionality the function uses.
That being said, I like that Nim and Koka did exactly that. You just tag the functions (IO, Async, Whatever) and it works.
In Haskell, you need monad transformers (which have a runtime costs) or whatever else was made to allow you to work with multiple different effects.
- siknad 5y ago> which have a runtime costs As monad is just an interface, it doesn't necessary cause runtime costs. Identity is a monad too. Effects may not always require sacrificing performance, but as they can be used to implement exceptions they are not just free compile time annotations. Also the differences discussed there: https://www.reddit.com/r/haskell/comments/3nkv2a/why_dont_we_use_effect_handlers_as_opposed_to/ https://www.reddit.com/r/haskell/comments/3nkv2a/why_dont_we...
- DarylZero 5y agoMonad transformers are different from monads. Monad transformers do have runtime costs, they are adding indirection at runtime.
- whateveracct 5y agoSometimes - it's pretty cool what GHC can do