
16 Dec
2013
16 Dec
'13
6:32 p.m.
* David Luposchainsky
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