Removing MonadFail from Monad

Roman Cheplyaka roma at ro-che.info
Mon Dec 16 23:32:56 UTC 2013


* David Luposchainsky <dluposchainsky at googlemail.com> [2013-12-16 23:57:19+0100]
> > I don't understand the restriction "is defined via data" since I am not
> > aware of defining constructors outside of data or with something other
> > than the data keyword.  Please clarify.
> 
> I meant "data and not newtype". If "Only" is a newtype data constructor,
> the pattern is irrefutable by design, is it not?

One notable case of one-constructor types defined not via data is
tuples. You certainly don't want warnings for that!

Regarding newtypes vs data, I'm not so sure it should make a difference.
It's customary to make one-field types newtypes, and then, if one
realizes that more fields are needed, turn them into proper data types.

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/libraries/attachments/20131217/2322b653/attachment.sig>


More information about the Libraries mailing list