diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-08-24 08:18:09 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-08-24 08:18:09 -0400 |
commit | 51e517f30a3ef9fafa064f3fb5dd98f842b5c4ad (patch) | |
tree | 1e04bfd60b473189b68a93358fa21261cfab95f5 /doc | |
parent | c0bc51a495cc806fe18b7cd3bee63be6c0f7cf3e (diff) |
Document monadic shorthands
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual.tex | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/manual.tex b/doc/manual.tex index 052249ce..a5b9c44e 100644 --- a/doc/manual.tex +++ b/doc/manual.tex @@ -1389,6 +1389,8 @@ $$\begin{array}{l} \hspace{.1in} \to \mt{monad} \; \mt{m} \end{array}$$ +The Ur/Web compiler provides syntactic sugar for monads, similar to Haskell's \cd{do} notation. An expression $x \leftarrow e_1; e_2$ is desugarded to $\mt{bind} \; e_1 \; (\lambda x \Rightarrow e_2)$, and an expression $e_1; e_2$ is desugared to $\mt{bind} \; e_1 \; (\lambda () \Rightarrow e_2)$. + \subsection{Transactions} Ur is a pure language; we use Haskell's trick to support controlled side effects. The standard library defines a monad $\mt{transaction}$, meant to stand for actions that may be undone cleanly. By design, no other kinds of actions are supported. |