
5 Feb
2007
5 Feb
'07
9:38 a.m.
I wrote:
Why go to the trouble of creating a new monad? The existing ones are fine.
J. Garrett Morris wrote:
Mainly to keep the type error messages simpler.
There are two ways to get around that problem: 1. Make your functions polymorphic, using MonadState, MonadError, etc. Each function mentions only the capabilities that it needs, without having the whole monad stack in its type. 2. Use a type alias for the monad stack. (There are other big advantages of both of these.) Regards, Yitz