[Haskell-beginners] Data declarations

aditya siram aditya.siram at gmail.com
Fri Jun 3 15:37:59 CEST 2011


> 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.
-deech

[1] http://www.haskell.org/haskellwiki/GADT



More information about the Beginners mailing list