[Haskell-cafe] Re: Existencial quantification and polymorphic
datatypes (actually, components...)
Mauricio
briqueabraque at yahoo.com
Tue Jan 20 11:56:30 EST 2009
>> 4294967296 :: Integer
> (...)
> In the above you can see the polymorphism of the return type of
> fromInteger, it returns a Int8 or a Int32.
>
> You can see the polymorphism of the argument of "show", it takes an Int8
> or Int32 or Integer.
>
> The latest ghc-6.10.1 also allows avoiding use of SomeNum, see
> impredicative-polymorphism:
> http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#impredicative-polymorphism
>
>
Great, thanks! I'm enlightened :)
But how is this:
data SomeNum = forall a. SN a
different from:
data SomeNum = SN (forall a. a)
?
Maurício
More information about the Haskell-Cafe
mailing list