[Haskell] Rank-N types vs existential types

Tomasz Zielonka tomasz.zielonka at gmail.com
Wed Apr 27 07:27:13 EDT 2005


On Wed, Apr 27, 2005 at 09:16:16PM +1000, Andre Pang wrote:
> >data RankN  = RankNEq (forall a. Eq a => a -> a -> Bool)
> >            | RankNOrd (forall a. Ord a => a -> a -> Bool)
> >
> >data Exists = forall a. Eq a => ExistsEq (a -> a -> Bool)
> >            | forall a. Ord a => ExistsOrd (a -> a -> Bool)
> 
> The two seem pretty equivalent to me, since the data 
> constructors have the same type.

They don't:

    ExistsEq :: (Eq a) => (a -> a -> Bool) -> Exists
    RankNEq :: (forall a. (Eq a) => a -> a -> Bool) -> RankN

Best regards
Tomasz


More information about the Haskell mailing list