[Haskell-cafe] Either as a Monad instance
Brian Hulley
brianh at metamilk.com
Tue Oct 3 10:45:13 EDT 2006
Ross Paterson wrote:
> On Tue, Oct 03, 2006 at 07:52:54AM -0400, Lennart Augustsson wrote:
>> Yes, having fail in the Monad is a horrible wart.
>
> (As far as I know, it's there for the translation of pattern match
> failure in do-expressions.)
I think it would be much less of a wart if the signature for fail was just:
fail :: m a
because what's the point of the String argument anyway (other than trying to
hack a kind of half-baked debug facility into the language)?
Regards, Brian.
--
Logic empowers us and Love gives us purpose.
Yet still phantoms restless for eras long past,
congealed in the present in unthought forms,
strive mightily unseen to destroy us.
http://www.metamilk.com
More information about the Haskell-Cafe
mailing list