Changes between Version 12 and Version 13 of ScopedTypeVariables


Ignore:
Timestamp:
Jan 26, 2006 4:57:29 PM (10 years ago)
Author:
ross@…
Comment:

play up scoping in class/instance decls a bit

Legend:

Unmodified
Added
Removed
Modified
  • ScopedTypeVariables

    v12 v13  
    1515Quantification of type variables over expressions is needed.
    1616
     17Haskell already binds type variables in class and instance declarations.
     18It makes sense for these to also scope over bindings in the `where` part, but currently only GHC implements this.
     19
    1720GHC provides three extensions that bind type variables:
    1821
     
    2528        cmp x y = compare (f x) (f y)
    2629}}}
     30   This could be a bit awkward with class methods, where the signature can be a long way from the binding.
    2731
    2832 * Pattern type signatures.
     
    4448In future versions of GHC, type variables will be rigid (universally quantified).
    4549Hugs supports only pattern type signatures, with rigid type variables.
    46 
    47 In GHC, type variables in the head of a class or instance declaration scope over bindings in the `where` part.
    4850
    4951== References ==
     
    9799 * for pattern bindings, result type signatures.
    98100   Explicit universal quantification might be made mandatory.
    99 plus binding of type variables in instance heads.
     101plus binding of type variables in class and instance heads.