skip to main content
article

Rigorous Pattern Matching as a Language Feature

Published:05 April 2023Publication History
Skip Abstract Section

Abstract

Structural pattern-matching as a language feature has become more common in programming languages over the past decade. This paper will consider more generally the challenge of adding pattern matching as a programming language feature, from the points of view of language design, rigorous static error detection, and effectiveness. In this context, a pattern matching language feature can be seen as providing a more rigorous approach to handling the complex conditionals that arise in processing highly structured input.

References

  1. Xavier Leroy, Damien Doligez, Alain Frisch, Jacques Garrigue, Didier Rémy and Jérôme Vouillon (2021), Chapter 9, The OCaml Language, Section 6, Patterns, The OCaml Manual, https://ocaml.org /manual /patterns.html, retrieved 25-Feb-2022.Google ScholarGoogle Scholar
  2. Python Software Foundation (2022), 8.6 The Match Statement, The Python Language Reference, https://docs.python.org/3/reference/compound_stmts.html#the-matchstatement, retrieved 25-Feb-2022.Google ScholarGoogle Scholar
  3. Simon Marlow (ed.) (2010), 3.17 Pattern Matching, Haskell 2010 Language Report, https: //www.haskell.org /onlinereport /haskell2010 /haskellch3.html, retrieved 25-Feb-2022.Google ScholarGoogle Scholar
  4. Luca Maranget (2007). Warnings for pattern matching. Journal of Functional Programming, 17(3), 387--421. doi:10.1017/S0956796807006223, http://moscova.inria.fr/~maranget/papers/warn/index.html, retrieved 7-Jul-22.Google ScholarGoogle ScholarCross RefCross Ref
  5. LFabrice e Fessant and Luca Maranget. (2001). Optimizing Pattern Matching. ACM SIGPLAN Notices. 36. 10.1145/507635.507641.Google ScholarGoogle Scholar
  6. Gavin Bearman, JEP 427: Pattern Matching for switch (Third Preview), OpenJDK, https://openjdk.org/jeps/427, retrieved 7-Jul-22.Google ScholarGoogle Scholar
  7. Steve Klabnik, Carol Nichols, et al (2022), All the places patterns can be used, The Rust Programming Language, https://doc.rustlang. org/book/ch18-01-all-the-places-for-patterns.html, retrieved 7- Jul-22.Google ScholarGoogle Scholar
  8. Michael Brennan (2014), Regular Expressions, The GNU AWK User's Guide, https://www.gnu.org/software/gawk/manual/html_node/Regexp.html, retrieved 7-Jul-22.Google ScholarGoogle Scholar
  9. Tucker Taft, Robert Duff, et al (2022), 5.4 Case Statements, Ada Reference Manual, http://www.adaauth. org/standards/2xrm/html/RM-5--4.html, retrieved 8-Jul-22.Google ScholarGoogle Scholar
  10. Mikael Pettersson (1992), A Term Pattern-Match Compiler Inspired by Finite Automata Theory. In Workshop on Compiler Construction. Springer-Verlag, 1992. Lecture Notes in Computer Science 641.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Michael O. Rabin and Dana Scott (1959)., "Finite automata and their decision problems". IBM Journal of Research and Development. 3 (2): 114--125. doi:10.1147/rd.32.0114. ISSN 0018--8646.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. John E. Hopcroft (1971). An n logn algorithm for minimizing the states in a finite automaton. In: Kohavi, Z. (ed.) The Theory of Machines and Computations, pp. 189--196. Academic Press.Google ScholarGoogle ScholarCross RefCross Ref
  13. Manuel Fahndrich and John Boyland (1997). Staticallly Checkable Pattern Abstractions. Proceedings of the International Conference on Functional Programming (ICFP '97) | June 1997. https://www.researchgate.net/publication/236160052_Staticallly_Che ckable_Pattern_Abstractions, retrieved 11-Jul-2022Google ScholarGoogle Scholar
  14. Chris Okasaki (1999). "Red--black trees in a functional setting". Journal of Functional Programming. 9 (4): 471--477. doi:10.1017/S0956796899003494. ISSN 1469--7653.Google ScholarGoogle ScholarDigital LibraryDigital Library

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

  • Article Metrics

    • Downloads (Last 12 months)10
    • Downloads (Last 6 weeks)2

    Other Metrics

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader
About Cookies On This Site

We use cookies to ensure that we give you the best experience on our website.

Learn more

Got it!