Changes between Version 10 and Version 11 of ViewPatterns


Ignore:
Timestamp:
Jan 25, 2007 6:21:21 AM (9 years ago)
Author:
tullsen@…
Comment:

tweaking First Class Pattern section

Legend:

Unmodified
Added
Removed
Modified
  • ViewPatterns

    v10 v11  
    566566
    567567The disadvantages are as follows: 1) An extra syntactic construct that binds variables, the pattern binder, is required.
    568 2) Even with pattern binders, simple patterns look a clunkier than Haskell's patterns.
     5682) Even with pattern binders, simple patterns look clunkier than Haskell's patterns.
    5695693) No attempt is made to check for exhaustiveness of patterns.
    5705704) No attempt is made to integrate with Haskell's patterns, the idea is a proposal for an alternative when one needs more than simple patterns.
    571571
     572The examples at the top of this page would look like this with first class patterns:
     573{{{
     574  f = {%sing n} .-> n+1
     575                |>> 0
     576
     577  g =  {%sing True}  .-> 0
     578    .| {%sing False} .-> 1
     579                     |>> 2 
     580}}}
    572581=== First class abstractions ===
    573582