Changes between Version 9 and Version 10 of MonomorphicPatternBindings


Ignore:
Timestamp:
Sep 21, 2007 7:15:01 AM (7 years ago)
Author:
simonpj@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MonomorphicPatternBindings

    v9 v10  
    134134The only other sane way to get this working is to unroll the map by hand. 
    135135 
     136=== Fifth report === 
     137 
     138Matthew Naylor ([email protected]) writes: [http://www.cs.york.ac.uk/~mfn/sparsecheck SparseCheck] uses polymorhpic pattern bindings.  For example, a `SparseCheck` datatype for lists is written as 
     139{{{ 
     140  (nil :- (|>)) = datatype (ctr0 [] \/ ctr2 (:)) 
     141}}} 
     142This introduces two functions with types 
     143{{{ 
     144  nil  :: Term [a] 
     145  (|>) :: Term a -> Term [a] -> Term [a] 
     146}}} 
     147Without polymorphic pattern bindings, we would have to write something 
     148like: 
     149{{{ 
     150  nil = ctr0 0 [] 
     151  (|>) = ctr2 1 (:) 
     152}}} 
     153Notice that I must give each constructor a unique identifier 
     154''manually''. 
     155 
    136156 
    137157== Summary ==