Changes between Version 3 and Version 4 of ViewPatterns


Ignore:
Timestamp:
Jan 24, 2007 5:46:32 PM (7 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ViewPatterns

    v3 v4  
    320320  f (snoc | x xs) = ..          -- Use "|" instead of "->" 
    321321  g (bits 3 | b bs) = ... 
    322  
     322}}} 
     323Another possibility is to use a backward arrow, more like pattern guards: 
     324{{{ 
    323325  f ((x,xs) <- snoc) = ...  -- More like pattern guards 
     326}}} 
     327But that messes up the left-to-right flow that is useful in some cases. 
     328For example, compare these: 
     329{{{ 
     330  parsePacket1 (bits 3 -> n (bits n -> val bs)) = ... 
     331 
     332  parsePacket2 (n (val bs <- bits n) <- bits 3) = ... 
    324333}}} 
    325334