[Haskell] ANNOUNCE: haskell-src-exts 0.4.8

kahl at cas.mcmaster.ca kahl at cas.mcmaster.ca
Thu Jan 8 21:26:28 EST 2009

Niklas Broberg" <niklas.broberg at gmail.com> released a new version of
haskell-src-exts  --- Thank you Niklas! --- and listed as one of the
``missing features'':
 > - Support for (un-parenthesised) higher-ranked types as arguments.
 > haskell-src-exts supports e.g. foo :: b -> (forall a . [a]) -> b
 > but not foo :: b -> forall a . [a] -> b. Supporting the latter is
 > simply a parser issue, but a rather tricky one.

I would not think that this pair of parentheses can be ommitted
without changing the meaning;
I would parse

  b -> forall a . [a] -> b


  b -> forall a . ([a] -> b)

(I am also not sure whether Niklas meant to assert that those
 two types were equal, so this is just in case...)

Perhaps it helps as motivation to consider that
from a dependent-type point-of-view,
the function type constructor
is a special case of the dependent product type construction,
| a -> b  =  Pi _t :: a . b |,
where the bound variable, _t, does not occur in b.

That brings the function types into the same kind of syntactic mechanism
as forall-types, and:

   b -> forall a . [a] -> b
   Pi _t :: b . forall a . Pi _u :: [a] . b
   Pi _t : b . Pi _v : (forall a . [a]) . b
   b -> (forall a . [a]) -> b


More information about the Haskell mailing list