ok guys .. what is this "phantom type" concept? Is it a type theory thing or just Haskell type concept?
Vasili On Mon, Jul 28, 2008 at 8:53 PM, Bryan Donlan <[EMAIL PROTECTED]> wrote: > On Mon, Jul 28, 2008 at 08:48:23PM -0500, Galchin, Vasili wrote: > > what does a datatype with no constructors mean? > > > > E.g. > > > > data RSAStruct > > data EVP_PKEY > > data EVP_CIPHER > > data EVP_CIPHER_CTX > > data EVP_MD_CTX > > data EVP_MD > > data BIGNUM > > It's simply a datatype that can never have a value - a so-called > 'phantom type'. They're useful when you need a type (eg as the argument > for a ForeignPointer) but no need for an actual value. > > You can of course create values of these types using 'undefined', > 'error' and friends, but this is perhaps not very useful most of the > time :) >
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe