#4159: move Monad and MonadFix instances for Either from mtl to
base
Evan Laforge
qdunkan at gmail.com
Wed Jun 30 02:21:08 EDT 2010
> A reasonable case can be made for the existence of a monad that does
> something useful with fail. I don't think that that monad should be Either.
I don't mean to further derail the proposal, which I think is a worthy
one, but what's the feeling on a complete deprecation of 'fail' and
making 'pat <- ...' the same as 'let pat = ...'? I've never used it,
not because I've never come across a case where it would be useful,
but that I don't trust to remember the behaviour of 'fail' for this
particular monad and even if I do, maybe my reader doesn't.
So I prefer 'case xyz of { pat -> mzero/throw/whatever }'. It's more
wordy but clearer. Are there uses out there that really rely on the
conciseness afforded by refutable patterns?
More information about the Libraries
mailing list