next up previous contents
Next: HTTP Up: The Ur/Web Standard Library Previous: Monads   Contents

Transactions

Ur is a pure language; we use Haskell's trick to support controlled side effects. The standard library defines a monad $ \mathsf{transaction}$ , meant to stand for actions that may be undone cleanly. By design, no other kinds of actions are supported.

\begin{displaymath}\begin{array}{l}
\mathsf{con} \; \mathsf{transaction} :: \ma...
...on\_monad} : \mathsf{monad} \; \mathsf{transaction}
\end{array}\end{displaymath}

For debugging purposes, a transactional function is provided for outputting a string on the server process' stderr.

\begin{displaymath}\begin{array}{l}
\mathsf{val} \; \mathsf{debug} : \mathsf{string} \to \mathsf{transaction} \; \mathsf{unit}
\end{array}\end{displaymath}



2014-07-14