Abstract
Active patterns apply preprocessing functions to data type values before they are matched. This is of use for unfree data types where more than one representation exists for an abstract value: in many cases there is a specific representation for which function definitions become very simple, and active patterns just allow to assume this specific representation in function definitions. We define the semantics of active patterns and describe their implementation.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
W. E. Aitken and J. H. Reppy. Abstract Value Constructors. In ACM Workshop on ML and its Applications, pages 1–11, 1992.
F. W. Burton and R. D. Cameron. Pattern Matching with Abstract Data Types. Journal of Functional Programming, 3(2):171–190, 1993.
F. W. Burton. An Efficient Functional Implementation of FIFO queues. Information Processing Letters, 14:205–206, 1982.
W. N. Chin. Safe Fusion of Functional Expressions. In ACM Conf. on Lisp and Functional Programming, pages 11–20, 1992.
M. Erwig. Functional Programming with Graphs. In 2nd ACM SIGPLAN Int. Conf. on Functional Programming, 1997. To appear.
M. Mohnen. Context Patterns in Haskell. In 8th Int. Workshop on Implementation of Functional Languages, LNCS (this volume), 1996.
R. Milner, M. Tofte, and R. Harper. The Definition of Standard ML. MIT Press, Cambridge, MA, 1990.
P. Palao Gonstanza, R. Pe∼na, and M. Nú∼nez. A New Look at Pattern Matching in Abstract Data Types. In 1st ACM SIGPLAN Int. Conf. on Functional Programming, pages 110–121, 1996.
S. Thompson. Lawful Functions and Program Verification in Miranda. Science of Computer Programming, 13:181–218, 1990.
D. A. Turner. Miranda: A Non-strict Functional Language with Polymorphic Types. In Conf. on Functional Programming and Computer Architecture, LNCS 201, pages 1–16, 1985.
P. Wadler. Views: A Way for Pattern Matching to Cohabit with Data Abstraction. In ACM Symp. on Principles of Programming Languages, pages 307–313, 1987.
P. Wadler. Deforestation: Transforming Programs to Eliminate Trees. Theoretical Computer Science, 73:231–284, 1990.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Erwig, M. (1997). Active patterns. In: Kluge, W. (eds) Implementation of Functional Languages. IFL 1996. Lecture Notes in Computer Science, vol 1268. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-63237-9_17
Download citation
DOI: https://doi.org/10.1007/3-540-63237-9_17
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-63237-5
Online ISBN: 978-3-540-69239-3
eBook Packages: Springer Book Archive