Changes between Version 18 and Version 19 of ScopedTypeVariables
 Timestamp:
 Sep 8, 2006 10:50:20 AM (9 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

ScopedTypeVariables
v18 v19 103 103 104 104 ''Notes'': 105 * If there were a special syntax for binding type variables in existentials, pattern type signatures would be independent of type variable binding (and thus a separate design choice). 105 * [wiki:RankNTypes] allows function types like 106 {{{ 107 shallowTerm :: (forall a. Data a => Maybe a) > (forall b. Data b => b) 108 }}} 109 in which referring to the type variable `b` seems to require a binding in a result type signature. 110 In this case the `forall` and context can be floated out, but not if they were buried in a type synonym. 111 * If there were a special syntax for binding type variables in existentials, pattern type signatures would be independent of type variable binding (and thus an othogonal design choice). 106 112 * If the language does not include [wiki:GADTs], such type variables could be bound with a new pattern syntax mimicking the `data` declaration, e.g. 107 113 {{{ 108 114 data Accum a = forall s. MkAccum s (a > s > s) (s > a) 109 115 110 f (forall s. MkAccum st ate add extr) = ...116 f (forall s. MkAccum st a e) = ... 111 117 }}} 112 118 (''Mutatis mutandi'' for other variants of ExistentialQuantification syntax.) 119 With [wiki:GADTs] one can define existential types without explicit quantification, so the order of multiple type variables wouldn't be clear. 113 120 114 121 == Pros ==