Skip to main content
    • Aa
    • Aa
  • Get access
    Check if you have access via personal or institutional login
  • Cited by 37
  • Cited by
    This article has been cited by the following publications. This list is generated based on data provided by CrossRef.

    BOVE, ANA KRAUSS, ALEXANDER and SOZEAU, MATTHIEU 2016. Partiality and recursion in interactive theorem provers – an overview. Mathematical Structures in Computer Science, Vol. 26, Issue. 01, p. 38.

    Karachalias, Georgios Schrijvers, Tom Vytiniotis, Dimitrios and Jones, Simon Peyton 2015. GADTs meet their match: pattern-matching warnings that account for GADTs, guards, and laziness. ACM SIGPLAN Notices, Vol. 50, Issue. 9, p. 424.

    Karachalias, Georgios Schrijvers, Tom Vytiniotis, Dimitrios and Jones, Simon Peyton 2015. Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming - ICFP 2015. p. 424.

    Fowler, Simon and Brady, Edwin 2014. Proceedings of the 25th symposium on Implementation and Application of Functional Languages - IFL '13. p. 49.

    McBride, Conor Thomas 2014. How to keep your neighbours in order. ACM SIGPLAN Notices, Vol. 49, Issue. 9, p. 297.

    BRADY, EDWIN 2013. Idris, a general-purpose dependently typed programming language: Design and implementation. Journal of Functional Programming, Vol. 23, Issue. 05, p. 552.

    Stutterheim, Jurriën Swierstra, Wouter and Swierstra, Doaitse 2013. Forty hours of declarative programming: Teaching Prolog at the Junior College Utrecht. Electronic Proceedings in Theoretical Computer Science, Vol. 106, p. 50.

    SWIERSTRA, WOUTER and VAN NOORT, THOMAS 2013. A library for polymorphic dynamic typing. Journal of Functional Programming, Vol. 23, Issue. 03, p. 229.

    Wang, Meng Gibbons, Jeremy Matsuda, Kazutaka and Hu, Zhenjiang 2013. Refactoring pattern matching. Science of Computer Programming, Vol. 78, Issue. 11, p. 2216.

    Abel, Andreas Scherer, Gabriel and Urzyczyn, Pawel 2012. On Irrelevance and Algorithmic Equality in Predicative Type Theory. Logical Methods in Computer Science, Vol. 8, Issue. 1,

    Awodey, Steve Gambino, Nicola and Sojakova, Kristina 2012. 2012 27th Annual IEEE Symposium on Logic in Computer Science. p. 95.

    Benton, Nick Hur, Chung-Kil Kennedy, Andrew J. and McBride, Conor 2012. Strongly Typed Term Representations in Coq. Journal of Automated Reasoning, Vol. 49, Issue. 2, p. 141.

    BERNARDY, JEAN-PHILIPPE JANSSON, PATRIK and PATERSON, ROSS 2012. Proofs for free. Journal of Functional Programming, Vol. 22, Issue. 02, p. 107.

    POUILLARD, NICOLAS and POTTIER, FRANÇOIS 2012. A unified treatment of syntax with binders. Journal of Functional Programming, Vol. 22, Issue. 4-5, p. 614.

    Swierstra, Wouter 2012. From Mathematics to Abstract Machine: A formal derivation of an executable Krivine machine. Electronic Proceedings in Theoretical Computer Science, Vol. 76, p. 163.

    Wiedijk, Freek and Urzyczyn, Pawel 2012. A Synthesis of the Procedural and Declarative Styles of Interactive Theorem Proving. Logical Methods in Computer Science, Vol. 8, Issue. 1,

    Abel, Andreas and Kraus, Nicolai 2011. A Lambda Term Representation Inspired by Linear Ordered Logic. Electronic Proceedings in Theoretical Computer Science, Vol. 71, p. 1.

    Capretta, Venanzio 2011. Coalgebras in functional programming and type theory. Theoretical Computer Science, Vol. 412, Issue. 38, p. 5006.

    Malecha, Gregory Morrisett, Greg and Wisnesky, Ryan 2011. Trace-based verification of imperative programs with I/O. Journal of Symbolic Computation, Vol. 46, Issue. 2, p. 95.

    Dix, Alan Lepouras, Giorgos Katifori, Akrivi Vassilakis, Costas Catarci, Tiziana Poggi, Antonella Ioannidis, Yannis Mora, Miguel Daradimos, Ilias Md.Akim, Nazihah Humayoun, Shah Rukh and Terella, Fabio 2010. From the web of data to a world of action. Web Semantics: Science, Services and Agents on the World Wide Web, Vol. 8, Issue. 4, p. 394.


The view from the left

  • DOI:
  • Published online: 01 January 2004

Pattern matching has proved an extremely powerful and durable notion in functional programming. This paper contributes a new programming notation for type theory which elaborates the notion in various ways. First, as is by now quite well-known in the type theory community, definition by pattern matching becomes a more discriminating tool in the presence of dependent types, since it refines the explanation of types as well as values. This becomes all the more true in the presence of the rich class of datatypes known as inductive families (Dybjer, 1991). Secondly, as proposed by Peyton Jones (1997) for Haskell, and independently rediscovered by us, subsidiary case analyses on the results of intermediate computations, which commonly take place on the right-hand side of definitions by pattern matching, should rather be handled on the left. In simply-typed languages, this subsumes the trivial case of Boolean guards; in our setting it becomes yet more powerful. Thirdly, elementary pattern matching decompositions have a well-defined interface given by a dependent type; they correspond to the statement of an induction principle for the datatype. More general, user-definable decompositions may be defined which also have types of the same general form. Elementary pattern matching may therefore be recast in abstract form, with a semantics given by translation. Such abstract decompositions of data generalize Wadler's (1987) notion of ‘view’. The programmer wishing to introduce a new view of a type $\mathit{T}$, and exploit it directly in pattern matching, may do so via a standard programming idiom. The type theorist, looking through the Curry–Howard lens, may see this as proving a theorem, one which establishes the validity of a new induction principle for $\mathit{T}$. We develop enough syntax and semantics to account for this high-level style of programming in dependent type theory. We close with the development of a typechecker for the simply-typed lambda calculus, which furnishes a view of raw terms as either being well-typed, or containing an error. The implementation of this view is ipso facto a proof that typechecking is decidable.

Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *