
30 Jun
2010
30 Jun
'10
7:20 p.m.
On Wed, Jun 30, 2010 at 6:29 PM, Claus Reinke
Note that my opposition is against making 'Monad (Either a)' less
defined and less tunable than it is at the moment.
It's a common trade-off: the Error constraint limits the instances that are available, but gives you a bit more when you have an instance. One must weigh the relative value of fail vs the unconstrained instance.
If there is no full definition of 'Monad (Either a)' for all 'a', then qualifying 'a' by an additional type class seems to be the standard Haskell solution. As I said, even if you just want to drop 'Error', you could define 'fail s = Left (error s)'. That would still be less defined
Actually, I rather like this option. =) -Edward Kmett