
3 Jun
2011
3 Jun
'11
11:44 a.m.
On Fri, Jun 3, 2011 at 09:37, aditya siram
One more question, out of curiosity: In your above example, you could change
data Populated = Populated data New = New
to simply
data Populated data New
correct? You might as well, right, since your constructors take no values, and you are just using them as phantom types?
Yes I think that's correct. You might also look at GADT's [1] which cover some of the same use-cases.
The reason for the former is that the latter is not accepted by Haskell 98, so it's a little less portable.