Changes between Version 3 and Version 4 of ViewPatterns
- Timestamp:
- 01/24/07 09:46:32 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ViewPatterns
v3 v4 320 320 f (snoc | x xs) = .. -- Use "|" instead of "->" 321 321 g (bits 3 | b bs) = ... 322 322 }}} 323 Another possibility is to use a backward arrow, more like pattern guards: 324 {{{ 323 325 f ((x,xs) <- snoc) = ... -- More like pattern guards 326 }}} 327 But that messes up the left-to-right flow that is useful in some cases. 328 For example, compare these: 329 {{{ 330 parsePacket1 (bits 3 -> n (bits n -> val bs)) = ... 331 332 parsePacket2 (n (val bs <- bits n) <- bits 3) = ... 324 333 }}} 325 334
