[Haskell] Rank-N types vs existential types

Andre Pang ozone at algorithm.com.au
Wed Apr 27 07:36:44 EDT 2005

On 27/04/2005, at 9:26 PM, Krasimir Angelov wrote:

> RankN and Exists are completelly different. The types of RankNEq and
> ExistsEq constructors are:
> RankNEq :: (forall a. Eq a => a -> a -> Bool) -> RankN
> ExistsEq :: forall a. Eq a => (a -> a -> Bool) -> Exists
> i.e. RankNEq requires one argument, which is a polymorfic function
> that have to be applied to Eq dictonary. ExistsEq have two arguments:
> an Eq dictonary and function of type (a -> a -> Bool).

Thanks Krasimir and Tomasz for that clarification.  Unfortunately, I'm 
still a bit confused :).  Krasimir, from what you say, this sounds like 
a big difference in implementation, but from a Haskell 
(non-type-wizard) user's point of view, is there a practical difference 
between the two?  I can't think of a situation where 
rank-N/existentials couldn't be substituted for the other ...

% Andre Pang : trust.in.love.to.save  <http://www.algorithm.com.au/>

More information about the Haskell mailing list