How to replace failure by a list of successes
Proc. of a conference on Functional programming languages and computer architecture
Views: a way for pattern matching to cohabit with data abstraction
POPL '87 Proceedings of the 14th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Report on the programming language Haskell: a non-strict, purely functional language version 1.2
ACM SIGPLAN Notices - Haskell special issue
A new look at pattern matching in abstract data types
Proceedings of the first ACM SIGPLAN international conference on Functional programming
Statically checkable pattern abstractions
ICFP '97 Proceedings of the second ACM SIGPLAN international conference on Functional programming
JMatch: Iterable Abstract Pattern Matching for Java
PADL '03 Proceedings of the 5th International Symposium on Practical Aspects of Declarative Languages
MPC '08 Proceedings of the 9th international conference on Mathematics of Program Construction
Gradual refinement: blending pattern matching with data abstraction
MPC'10 Proceedings of the 10th international conference on Mathematics of program construction
Joinads: a retargetable control-flow construct for reactive, parallel and concurrent programming
PADL'11 Proceedings of the 13th international conference on Practical aspects of declarative languages
Extending monads with pattern matching
Proceedings of the 4th ACM symposium on Haskell
Declarative programming with function patterns
LOPSTR'05 Proceedings of the 15th international conference on Logic Based Program Synthesis and Transformation
Bimonadic semantics for basic pattern matching calculi
MPC'06 Proceedings of the 8th international conference on Mathematics of Program Construction
Proceedings of the 12th international conference on Generative programming: concepts & experiences
Science of Computer Programming
Hi-index | 0.00 |
Pattern matching is a great convenience in programming. However, pattern matching has its problems: it conflicts with data abstraction; it is complex (at least in Haskell, which has pattern guards, irrefutable patterns, n+k patterns, as patterns, etc.); it is a source of runtime errors; and lastly, one cannot abstract over patterns as they are not a first class language construct. This paper proposes a simplification of pattern matching that makes patterns first class. The key idea is to treat patterns as functions of type "a→ Maybe b"--i.e., "a→ (Nothing|Just b)"; thus, patterns and pattern combinators can be written as functions in the language.