Sie befinden Sich nicht im Netzwerk der Universität Paderborn. Der Zugriff auf elektronische Ressourcen ist gegebenenfalls nur via VPN oder Shibboleth (DFN-AAI) möglich. mehr Informationen...
Ergebnis 3 von 136
Open Access
The view from the left
Journal of functional programming, 2004-01, Vol.14 (1), p.69-111
2004
Volltextzugriff (PDF)

Details

Autor(en) / Beteiligte
Titel
The view from the left
Ist Teil von
  • Journal of functional programming, 2004-01, Vol.14 (1), p.69-111
Ort / Verlag
Cambridge, UK: Cambridge University Press
Erscheinungsjahr
2004
Quelle
EZB-FREE-00999 freely available EZB journals
Beschreibungen/Notizen
  • 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.
Sprache
Englisch
Identifikatoren
ISSN: 0956-7968
eISSN: 1469-7653
DOI: 10.1017/S0956796803004829
Titel-ID: cdi_proquest_journals_213507479
Format

Weiterführende Literatur

Empfehlungen zum selben Thema automatisch vorgeschlagen von bX