X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=week7.mdwn;h=65d528c45b0f13bf068fc31df047c9578f75ee6d;hp=857a636bad6dad17cdda8689905be7dd934174c9;hb=e8a135f7bc1a0aa4118703baa78ec8d2ea9db490;hpb=fdbafe49575c982a8583e256c16c721756bcc13c diff --git a/week7.mdwn b/week7.mdwn index 857a636b..65d528c4 100644 --- a/week7.mdwn +++ b/week7.mdwn @@ -479,9 +479,7 @@ invited talk, *19'th Symposium on Principles of Programming Languages*, ACM Pres Monads increase the ease with which programs may be modified. They can mimic the effect of impure features such as exceptions, state, and continuations; and also provide effects not easily achieved with such features. The types of a program reflect which effects occur. The first section is an extended example of the use of monads. A simple interpreter is modified to support various extra features: error messages, state, output, and non-deterministic choice. The second section describes the relation between monads and continuation-passing style. The third section sketches how monads are used in a compiler for Haskell that is written in Haskell.--> -* [Daniel Friedman. A Schemer's View of Monads](/schemersviewofmonads.ps): from but the link above is to a local copy. - -There's a long list of monad tutorials on the [[Offsite Reading]] page. Skimming the titles makes us laugh. +There's a long list of monad tutorials on the [[Offsite Reading]] page. (Skimming the titles is somewhat amusing.) If you are confused by monads, make use of these resources. Read around until you find a tutorial pitched at a level that's helpful for you. In the presentation we gave above---which follows the functional programming conventions---we took `unit`/return and `bind` as the primitive operations. From these a number of other general monad operations can be derived. It's also possible to take some of the others as primitive. The [Monads in Category Theory](/advanced_topics/monads_in_category_theory) notes do so, for example. @@ -577,13 +575,13 @@ Monad outlook ------------- We're going to be using monads for a number of different things in the -weeks to come. The first main application will be the State monad, +weeks to come. One major application will be the State monad, which will enable us to model mutation: variables whose values appear to change as the computation progresses. Later, we will study the Continuation monad. -In the meantime, we'll look at several linguistic applications for monads, based -on what's called the *reader monad*. +But first, we'll look at several linguistic applications for monads, based +on what's called the *Reader monad*. ##[[Reader monad]]##