| | 555 | === [http://citeseer.ist.psu.edu/tullsen00first.html Tullsen: First Class Patterns] === |
| | 556 | |
| | 557 | First Class Patterns is an approach that attempts to |
| | 558 | add the minimum of syntax to the language which---in combination with |
| | 559 | pattern combinators written within the language---can achieve everything |
| | 560 | and more that Haskell patterns can do. They have the value-input feature. |
| | 561 | |
| | 562 | The advantages are 1) They are simpler than Haskell's patterns; 2) Patterns are first class. |
| | 563 | 3) The binding mechanism (the pattern binder) is orthogonal to the the pattern combinators: |
| | 564 | the hope is that one can stop changing the syntax/semantics of patterns and concentrate on writing the |
| | 565 | combinators (as Haskell functions). |
| | 566 | |
| | 567 | The 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. |
| | 569 | 3) No attempt is made to check for exhaustiveness of patterns. |
| | 570 | 4) 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. |
| | 571 | |