|
|
|
# explicit quantification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In haskell 98 type expressions, all free variables are collected and treated
|
|
|
|
as if there was an implicit 'forall \<ts..\> .' in front of the type. This makes
|
|
|
|
certain extensions to the type system such as rank n types and scoped type
|
|
|
|
variables tricky to deal with while maintaining backwards compatability.
|
|
|
|
|
|
|
|
|
|
|
|
## proposal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Require explicit quantification on all expression bound type sigatures as in.
|
|
|
|
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
foo = (id :: forall a . a -> a) 'x'
|
|
|
|
```
|
| ... | ... | @@ -22,9 +26,13 @@ in the standard, following this rule would make it much easier on implementation |
|
|
|
do have them since it would mean that vaild haskell' programs could not become
|
|
|
|
invalid when scoped type variables are turned on. Although this is not backwards compatable, the issue comes up rarely, is easy to fix, and would produce an informative error message in most cases during the transition.
|
|
|
|
|
|
|
|
|
|
|
|
## more drastic proposal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require explicit quantification everywhere. The main argument for this is
|
|
|
|
consistancy. The main against is that it is not needed. No type variables are in scope in a let bound type signature so
|
|
|
|
consistancy. No type variables are in scope in a let bound type signature so
|
|
|
|
which variables should be quantified is unambiguous.
|
|
|
|
|
|
|
|
|