
20 Jan
2009
20 Jan
'09
12:19 p.m.
I just thought that the shorter explanation could do better: the difference is in the types of the constructor functions. Code:
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} data SomeNum1 = forall a. SN1 a data SomeNum2 = SN2 (forall a. a)
ghci session: *Main> :t SN1 SN1 :: a -> SomeNum1 *Main> :t SN2 SN2 :: (forall a. a) -> SomeNum2 This is not the whole story, types of the bound variables you get on pattern matching differ too, but this makes the short explanation a bit longer :).