|
|
|
|
|
|
|
allow extensential type synonyms, so if you had something like the
|
|
|
|
following,
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
data Type a = ....
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
you could declare a synonym such as
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
type AnyType = exists a . Type a
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
so you can create functions such as
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
areSame :: AnyType -> AnyType -> Bool
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
which would expand to
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
areSame :: forall a b . Type a -> Type b -> Bool
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
this is not to be confused with the currently allowed in ghc
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
type AllTypes = forall a . Type a
|
|
|
|
|
|
|
|
oddFunc :: AllTypes -> AllTypes -> Bool
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
which expands to the rank 2 type
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
oddFunc :: (forall a . Type a) -> (forall b . Type b) -> Bool
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
which means something quite different.
|
|
|
|
|
|
|
|
|
|
|
|
Pro
|
|
|
|
|
|
|
|
- if we use 'exists' for existential types, this seems like a natural use of said keyword too. |