Skip to main content

Active patterns

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1268))

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.

This is a preview of subscription content, log in via an institution.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. W. E. Aitken and J. H. Reppy. Abstract Value Constructors. In ACM Workshop on ML and its Applications, pages 1–11, 1992.

    Google Scholar 

  2. F. W. Burton and R. D. Cameron. Pattern Matching with Abstract Data Types. Journal of Functional Programming, 3(2):171–190, 1993.

    Google Scholar 

  3. F. W. Burton. An Efficient Functional Implementation of FIFO queues. Information Processing Letters, 14:205–206, 1982.

    Google Scholar 

  4. W. N. Chin. Safe Fusion of Functional Expressions. In ACM Conf. on Lisp and Functional Programming, pages 11–20, 1992.

    Google Scholar 

  5. M. Erwig. Functional Programming with Graphs. In 2nd ACM SIGPLAN Int. Conf. on Functional Programming, 1997. To appear.

    Google Scholar 

  6. M. Mohnen. Context Patterns in Haskell. In 8th Int. Workshop on Implementation of Functional Languages, LNCS (this volume), 1996.

    Google Scholar 

  7. R. Milner, M. Tofte, and R. Harper. The Definition of Standard ML. MIT Press, Cambridge, MA, 1990.

    Google Scholar 

  8. 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.

    Google Scholar 

  9. S. Thompson. Lawful Functions and Program Verification in Miranda. Science of Computer Programming, 13:181–218, 1990.

    Google Scholar 

  10. 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.

    Google Scholar 

  11. 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.

    Google Scholar 

  12. P. Wadler. Deforestation: Transforming Programs to Eliminate Trees. Theoretical Computer Science, 73:231–284, 1990.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Werner Kluge

Rights and permissions

Reprints 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

Publish with us

Policies and ethics