[Haskell-cafe] IO (Either a Error) question

John Meacham john at repetae.net
Fri May 7 22:26:29 EDT 2010


On Fri, May 07, 2010 at 08:27:04PM -0400, Dan Doel wrote:
> Personally, I don't really understand why unfailable patterns were canned
> (they don't seem that complicated to me), so I'd vote to bring them back, and
> get rid of fail. But hind sight is 20/20, I suppose (or perhaps there exist
> cogent arguments that I haven't heard).

What counts as unfailable?

(x,y) probably,  but what about

data Foo = Foo x y

If we don't allow it, we add 'magic' to tuples, which is a bad thing, if
we do allow it, there are some odd consequences.

adding another constructor to Foo will suddenly change the type of do
notations involving it non locally. said constructor may not even be
exported from the module defining Foo, its existence being an
implementation detail.

All in all, it is very hacky one way or another. Much more so than
having 'fail' in Monad.

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/


More information about the Haskell-Cafe mailing list