Changes between Version 11 and Version 12 of Rank2Types


Ignore:
Timestamp:
Feb 17, 2007 11:23:54 PM (7 years ago)
Author:
ross@…
Comment:

refine restriction (2)

Legend:

Unmodified
Added
Removed
Modified
  • Rank2Types

    v11 v12  
    1010g :: (forall a. a -> a) -> (Bool, Char) 
    1111}}} 
    12  2. In the definition of the function, polymorphic arguments must be matched on the left-hand side, and can only be matched by a variable or wildcard (`_`) pattern.  The variable then has the polymorphic type of the corresponding argument, e.g. 
    13     {{{ 
     12 2. In the definition of the function, polymorphic arguments 
     13   1. must be matched on the left-hand side, and 
     14   1. can only be matched by a variable or wildcard (`_`) pattern.  The variable then has the polymorphic type of the corresponding argument, e.g. 
     15      {{{ 
    1416g f = (f True, f 'a') 
    1517}}} 
    16  3. When such a function is used, it must be applied to at least as many arguments to include the polymorphic ones (so it's a good idea to put those first).  Each expression must have a generalized type at least as general as that declared for the corresponding argument, e.g. 
     18 4. When such a function is used, it must be applied to at least as many arguments to include the polymorphic ones (so it's a good idea to put those first).  Each expression must have a generalized type at least as general as that declared for the corresponding argument, e.g. 
    1719    {{{ 
    1820g id 
    1921g undefined 
    2022}}} 
    21 The more general [wiki:RankNTypes] remove the last restriction in many cases. 
     23The more general [wiki:RankNTypes] relax restrictions 2(1) and 3. 
    2224 
    2325== References ==