3 ms·
Monads are not the same thing as effect types - the latter are most commonly modeled as Lawvere theories. They are at a different level of composability. Regar
by zozbot234 6y ago
Monads are not the same thing as effect types - the latter are most commonly modeled as Lawvere theories. They are at a different level of composability.
Regardless, this blogpost is about Rust which has yet to gain either feature, for well-known reasons (for one thing, monadic bind notation interacts badly w/ the multiple closure types in Rust). Talking about Haskell monads just does not seem all that relevant in this context.
- tome 6y agoCould you elaborate? Firstly, I'm not aware of any programming languages that has Lawvere theories as a first-class concept. Secondly, when I last looked into Lawvere theories I couldn't work out any way of making them into a first-class concept in any way that would make them distinct from monads. (On the other hand Lawvere theories may be useful for modelling effects in type theories. That may be so (I don't know) but is an orthogonal issue.)
- sullyj3 6y agoI don't really know much about this area, but there's a language literally called Lawvere. https://github.com/jameshaydon/lawvere https://github.com/jameshaydon/lawvere
- flqn 6y agoMonads are not the same as effect types, but Haskell affords implementing effects using monads, so I'd argue the comparison is relevant.
- willtim 6y ago> Monads are not the same thing as effect types Monads can be used to implement "effect types" and define the semantics of them. I believe this is how Koka works. > Talking about Haskell monads just does not seem all that relevant in this context. I respectfully disagree. Async/Await first appeared in F# as a Monad (Computational Workflow). Monads also do not necessarily have to involve closures at runtime, they can be useful just to define semantics and build type-checkers.
- deleted 6y ago[deleted]
- lmm 6y agoHaskell-like monads are absolutely relevant. They're a common solution to this problem in Rust-like languages, and while there may be some Rust-specific concerns to be addressed it's not at all clear that any of them are real blockers.