Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/351240.351257acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article
Free access

Recursive monadic bindings

Published: 01 September 2000 Publication History

Abstract

Monads have become a popular tool for dealing with computational effects in Haskell for two significant reasons: equational reasoning is retained even in the presence of effects; and program modularity is enhanced by hiding "plumbing" issues inside the monadic infrastructure. Unfortunately, not all the facilities provided by the underlying language are readily available for monadic computations. In particular, while recursive monadic computations can be defined directly using Haskell's built-in recursion capabilities, there is no natural way to express recursion over the values of monadic actions. Using examples, we illustrate why this is a problem, and we propose an extension to Haskell's donotation to remedy the situation. It turns out that the structure of monadic value-recursion depends on the structure of the underlying monad. We propose an axiomatization of the recursion operation and provide a catalogue of definitions that satisfy our criteria.

References

[1]
P. Bjesse, K. Claessen, M. Sheeran, and S. Singh. Lava: Hardware design in Haskell. In International Conference on Functional Programming, Baltimore, July 1998.
[2]
T. Cormen, C. Leiserson, and R. Rivest. Introduction to Algorithms. The MIT Press, Cambridge, MA, 1989.
[3]
R. L. Croleand A.M. Pitts. New foundations for fixpoint computations. In Proceedings of the Fifth Annual IEEE Symposium onLogic in Computer Science, pages 489-497, June 1990.
[4]
L. Erkok and J. Launchbury. A recursive do for Haskell: Design and Implementation. Available at http://www.cse.ogi.edu/PacSoft/projects/muHugs.
[5]
L. Erkok and J. Launchbury. Recursive monadic bindings: Technical development and details. Technical Report CSE-00-011, Department of Computer Science and Engineering, Oregon Graduate Institute of Science and Technology, June 2000.
[6]
D. Friedman and A. Sabry. Recursion is a computational e~ect. Unpublished. Available at http://www.cs.uoregon.edu/~sabry/papers.
[7]
M. Hasegawa. Recursion from cyclic sharing: traced monoidal categories and models of cyclic lambda calculi. Lecture Notes in Computer Science, 1210, 1997.
[8]
J. Hughes. Generalising monads to arrows. Science of Computer Programming, 37(1-3):67-111, May 2000.
[9]
M. P. Jones and L. Duponcheel. Composing monads. Technical Report YALEU/DCS/RR-1004, Department of Computer Science, Yale University, Dec. 1993.
[10]
J. Launchbury. Lazy imperative programming. In Proceedings of the ACM SIGPLAN Workshop on State in Programming Languages, Copenhagen, DK, SIPL '92, pages 46-56, 1993.
[11]
J. Launchbury, J. Lewis, and B. Cook. On embedding a microarchitectural design language within Haskell. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP '99), pages 60-69, 1999.
[12]
J. Launchbury and R. Paterson. Parametricity and unboxing with unpointed types. In European Symposium ofProgramming, volume 1058 of Lecture Notes in Computer Science, pages 204-218. Springer, Apr. 1996.
[13]
J. Launchbury and S. L. Peyton Jones. Lazy functional state threads. ACM SIGPLAN Notices, 29(6):24-35, June 1994.
[14]
J. Launchbury and S. L. Peyton Jones. State in Haskell. Lisp and Symbolic Computation, 8(4):293-341, Dec. 1995.
[15]
J. Lewis, M. Shields, E. Meijer, and J. Launchbury. Implicit parameters: Dynamic scoping with static types. In Proceedings of the ACM SIGPLAN-SIGACT Symposium onPrinciples of Programming Languages (POPL '00), 2000.
[16]
J. Matthews, B. Cook, and J. Launchbury. Microprocessor specifcation in Hawk. In Proceedings of the 1998 International Conference on Computer Languages, pages 90-101. IEEE Computer Society Press, 1998.
[17]
E. Moggi. Notions of computation and monads. Information and Computation, 93(1), 1991.
[18]
J. Nordlander. Reactive Objects and Functional Programming. PhD thesis, Chalmers University of Technology, G? oteborg, Sweden, 1999.
[19]
A. Simpson and G. Plotkin. Complete axioms for categorical ~xed-point operators. Proceedings of Fifteenth Annual IEEE Symposium on Logic in Computer Science, 2000 (To appear).
[20]
P. Wadler. Theorems for free! In FPCA'89, London, England, pages 347-359. ACM Press, Sept. 1989.
[21]
P. Wadler. Comprehending Monads. In LISP'90, Nice, France, pages 61-78. ACM Press, 1990.
[22]
G. Winskel. The Formal Semantics of Programming Languages: An Introduction. Foundations of Computing series. MIT Press, Feb. 1993.

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP '00: Proceedings of the fifth ACM SIGPLAN international conference on Functional programming
September 2000
294 pages
ISBN:1581132026
DOI:10.1145/351240
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 September 2000

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

ICFP00
Sponsor:

Acceptance Rates

ICFP '00 Paper Acceptance Rate 24 of 110 submissions, 22%;
Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)83
  • Downloads (Last 6 weeks)17
Reflects downloads up to 12 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2017)Packrats parse in packsACM SIGPLAN Notices10.1145/3156695.312295852:10(14-25)Online publication date: 7-Sep-2017
  • (2017)Packrats parse in packsProceedings of the 10th ACM SIGPLAN International Symposium on Haskell10.1145/3122955.3122958(14-25)Online publication date: 7-Sep-2017
  • (2016)Free delivery (functional pearl)ACM SIGPLAN Notices10.1145/3241625.297600551:12(45-50)Online publication date: 8-Sep-2016
  • (2016)Free delivery (functional pearl)Proceedings of the 9th International Symposium on Haskell10.1145/2976002.2976005(45-50)Online publication date: 8-Sep-2016
  • (2015)The remote monad design patternACM SIGPLAN Notices10.1145/2887747.280431150:12(59-70)Online publication date: 30-Aug-2015
  • (2015)The remote monad design patternProceedings of the 2015 ACM SIGPLAN Symposium on Haskell10.1145/2804302.2804311(59-70)Online publication date: 30-Aug-2015
  • (2015)Personalizing Search on Shared DevicesProceedings of the 38th International ACM SIGIR Conference on Research and Development in Information Retrieval10.1145/2766462.2767736(523-532)Online publication date: 9-Aug-2015
  • (2015)Programs for Cheap!Proceedings of the 2015 30th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)10.1109/LICS.2015.21(115-126)Online publication date: 6-Jul-2015
  • (2014)Domain-specific Languages and Code Synthesis Using HaskellQueue10.1145/2611429.261781112:4(30-43)Online publication date: 15-Apr-2014
  • (2014)Domain-specific languages and code synthesis using HaskellCommunications of the ACM10.1145/260520557:6(42-49)Online publication date: 1-Jun-2014
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media