Mercurial > urweb
comparison doc/manual.tex @ 1544:a99b743a3087
Basis.mkMonad
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 19 Aug 2011 15:23:01 -0400 |
parents | 6f046b4bad24 |
children | 76dab73304a5 |
comparison
equal
deleted
inserted
replaced
1543:6f046b4bad24 | 1544:a99b743a3087 |
---|---|
1380 \hspace{.1in} \to \mt{monad} \; \mt{m} \\ | 1380 \hspace{.1in} \to \mt{monad} \; \mt{m} \\ |
1381 \hspace{.1in} \to \mt{t} \to \mt{m} \; \mt{t} \\ | 1381 \hspace{.1in} \to \mt{t} \to \mt{m} \; \mt{t} \\ |
1382 \mt{val} \; \mt{bind} : \mt{m} ::: (\mt{Type} \to \mt{Type}) \to \mt{t1} ::: \mt{Type} \to \mt{t2} ::: \mt{Type} \\ | 1382 \mt{val} \; \mt{bind} : \mt{m} ::: (\mt{Type} \to \mt{Type}) \to \mt{t1} ::: \mt{Type} \to \mt{t2} ::: \mt{Type} \\ |
1383 \hspace{.1in} \to \mt{monad} \; \mt{m} \\ | 1383 \hspace{.1in} \to \mt{monad} \; \mt{m} \\ |
1384 \hspace{.1in} \to \mt{m} \; \mt{t1} \to (\mt{t1} \to \mt{m} \; \mt{t2}) \\ | 1384 \hspace{.1in} \to \mt{m} \; \mt{t1} \to (\mt{t1} \to \mt{m} \; \mt{t2}) \\ |
1385 \hspace{.1in} \to \mt{m} \; \mt{t2} | 1385 \hspace{.1in} \to \mt{m} \; \mt{t2} \\ |
1386 \mt{val} \; \mt{mkMonad} : \mt{m} ::: (\mt{Type} \to \mt{Type}) \\ | |
1387 \hspace{.1in} \to \{\mt{Return} : \mt{t} ::: \mt{Type} \to \mt{t} \to \mt{m} \; \mt{t}, \\ | |
1388 \hspace{.3in} \mt{Bind} : \mt{t1} ::: \mt{Type} \to \mt{t2} ::: \mt{Type} \to \mt{m} \; \mt{t1} \to (\mt{t1} \to \mt{m} \; \mt{t2}) \to \mt{m} \; \mt{t2}\} \\ | |
1389 \hspace{.1in} \to \mt{monad} \; \mt{m} | |
1386 \end{array}$$ | 1390 \end{array}$$ |
1387 | 1391 |
1388 \subsection{Transactions} | 1392 \subsection{Transactions} |
1389 | 1393 |
1390 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. | 1394 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. |