Changes between Initial Version and Version 1 of ExistentialTypeSynonyms


Ignore:
Timestamp:
Jan 24, 2006 12:57:17 AM (10 years ago)
Author:
john@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExistentialTypeSynonyms

    v1 v1  
     1allow extensential type synonyms, so if you had something like the
     2following,
     3{{{
     4data Type a = ....
     5}}}
     6you could declare a synonym such as
     7{{{
     8type AnyType = exists a . Type a
     9}}}
     10so you can create functions such as
     11{{{
     12areSame :: AnyType -> AnyType -> Bool
     13}}}
     14
     15which would expand to
     16{{{
     17areSame :: forall a b . Type a -> Type b -> Bool
     18}}}
     19
     20this is not to be confused with the currently allowed in ghc
     21{{{
     22type AllTypes = forall a . Type a
     23
     24oddFunc :: AllTypes -> AllTypes -> Bool
     25
     26}}}
     27which expands to the rank 2 type
     28{{{
     29oddFunc :: (forall a . Type a) -> (forall b . Type b) -> Bool
     30}}}
     31
     32which means something quite different.
     33
     34Pro
     35
     36 * if we use 'exists' for existential types, this seems like a natural use of said keyword too.