[Haskell-cafe] Type without a data constructor?

Neil Mitchell ndmitchell at gmail.com
Mon Aug 6 19:32:27 EDT 2007


Hi

> I by mistake defined a type which did not specify a data constructor
>
> So the question is what are types with no constructors good for? A
> simple example would be appreciated.

They are called phantom types, and can be used for ensuring properties
at the type level.

I wrote about them in a blog post:

http://neilmitchell.blogspot.com/2007/04/phantom-types-for-real-problems.html

There are probably better references, but that's the easiest for me to find ;-)

Thanks

Neil


More information about the Haskell-Cafe mailing list