Monad of no `return` Proposal (MRP): Moving `return` out of `Monad`

David Luposchainsky dluposchainsky at googlemail.com
Sun Sep 27 22:22:27 UTC 2015


On 28.09.2015 00:16, David Feuer wrote:
> For the benefit of people trying out code from papers, tutorials, etc., would it
> be possible to craft a permanent custom error message for explicit return
> definitions? I don't remember AMP having such for the new constraint; if it
> doesn't, maybe it should.

Sure, that's something we can probably do. I've done some (futile) digging in
GHC, but the plan is to implement this as a "if a Monad definition contains a
binding referring to 'return' emit a warning", which is or can be made orthogonal
of there actually being a "return" in the actual class.



More information about the Libraries mailing list