Changes between Version 3 and Version 4 of ViewPatternsNew


Ignore:
Timestamp:
Jul 18, 2007 4:00:26 PM (8 years ago)
Author:
danl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ViewPatternsNew

    v3 v4  
    4646
    4747'''Scoping''' for ''expr `->` ''pat:
    48 * The variables bound by the view pattern are the variables bound by ''pat''.
    49 * Any variables in ''expr'' are bound occurrences.
    50 ** In function definitions, variables bound by matching earlier curried arguments may be used in view pattern expressions in later arguments.
     48 * The variables bound by the view pattern are the variables bound by ''pat''.
     49 * Any variables in ''expr'' are bound occurrences.
     50   * In function definitions, variables bound by matching earlier curried arguments may be used in view pattern expressions in later arguments.
    5151{{{
    5252   example :: (String -> Integer) -> String -> Bool
    5353   example f (f -> 4) = True
    5454}}}
    55 
    56 ** However, pattern variables do not scope over the pattern in which they are bound.
     55   * However, pattern variables do not scope over the pattern in which they are bound.
    5756{{{
    5857   -- doesn't work
     
    116115that now may be used in view patterns.
    117116
    118 === Partial views ===
     117==== Partial views ====
    119118
    120119Here's an alternate style of view definition: rather than mapping the abstract type to a single sum type, you provide outjections inverting each constructor: