I was wondering if this would make sense allow extensential type synonyms, so if you had something like the following,
data Type a = ....
you could declare a synonym such as
type AnyType = exists a . Type a
so you can create functions such as
areSame :: AnyType -> AnyType -> Bool
which would expand to
areSame :: forall a b . Type a -> Type b -> Bool
this is opposed to the currently allowed in ghc
type AllTypes = forall a . Type a
oddFunc :: AllTypes -> AllTypes -> Bool
which expands to the rank 2 type
oddFunc :: (forall a . Type a) -> (forall b . Type b) -> Bool
which means something quite different. if we use 'exists' for existential types, this might be another useful use of said name. John -- John Meacham - ⑆repetae.net⑆john⑈
Hello John, Tuesday, December 13, 2005, 6:27:53 AM, you wrote:
areSame :: AnyType -> AnyType -> Bool
JM> which would expand to
areSame :: forall a b . Type a -> Type b -> Bool
it is not easier to just define areSame as areSame :: Type a -> Type b -> Bool without even declaring AnyType? -- Best regards, Bulat mailto:bulatz@HotPOP.com
participants (2)
-
Bulat Ziganshin -
John Meacham