University of Cambridge > Talks.cam > Computer Laboratory Programming Research Group Seminar > Syntax Matters: Writing abstract computations in F#

Syntax Matters: Writing abstract computations in F#

Add to your list(s) Download to your calendar using vCal

If you have a question about this talk, please contact Dominic Orchard.

The academic literature describes a number of abstract computation types such as monads, applicative functors and their compositions. These can be used to describe features of mainstream languages such as generators in Python or asynchronous computations in C# 5, but working with abstract computations without a convenient syntactic sugar is difficult.

In this paper, we describe computation expressions, which is a syntactic sugar for working with abstract computations in F# 2.0. Unlike the do notation in Haskell, computation expressions are not tied to a single kind of abstract computations. They support wider range of computations, depending on what operations are available and they also provide greater syntactic flexibility.

As a result, F# programmers are able to use a single syntactic sugar for a wider range of computations including monoidal sequence generators, monadic parsers and applicative formlets. This removes the need for ad-hoc language extensions that provide “nice syntax” for one particular kind of computations.

This is a practice talk for TFP ’12. Joint work with Don Syme.

This talk is part of the Computer Laboratory Programming Research Group Seminar series.

Tell a friend about this talk:

This talk is included in these lists:

Note that ex-directory lists are not shown.

 

© 2006-2024 Talks.cam, University of Cambridge. Contact Us | Help and Documentation | Privacy and Publicity