Evaluation strategies for monadic computations

Computer Science – Programming Languages

Scientific paper

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

In Proceedings MSFP 2012, arXiv:1202.2407

Scientific paper

10.4204/EPTCS.76.7

Monads have become a powerful tool for structuring effectful computations in functional programming, because they make the order of effects explicit. When translating pure code to a monadic version, we need to specify evaluation order explicitly. Two standard translations give call-by-value and call-by-name semantics. The resulting programs have different structure and types, which makes revisiting the choice difficult. In this paper, we translate pure code to monadic using an additional operation malias that abstracts out the evaluation strategy. The malias operation is based on computational comonads; we use a categorical framework to specify the laws that are required to hold about the operation. For any monad, we show implementations of malias that give call-by-value and call-by-name semantics. Although we do not give call-by-need semantics for all monads, we show how to turn certain monads into an extended monad with call-by-need semantics, which partly answers an open question. Moreover, using our unified translation, it is possible to change the evaluation strategy of functional code translated to the monadic form without changing its structure or types.

No associations

LandOfFree

Say what you really think

Search LandOfFree.com for scientists and scientific papers. Rate them and share your experience with other people.

Rating

Evaluation strategies for monadic computations does not yet have a rating. At this time, there are no reviews or comments for this scientific paper.

If you have personal experience with Evaluation strategies for monadic computations, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Evaluation strategies for monadic computations will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFWR-SCP-O-88578

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.