[Ur] how to use conditions in monads?

Vladimir Shabanov vshabanoff at gmail.com
Fri Sep 2 09:11:46 EDT 2011


2011/9/2 Gergely Buday <gbuday at gmail.com>:
> Hi there,
>
> what is a no-operation idiom for Ur/Web that I could put into an else
> clause in a transaction monad?
>
> stored <- get store;
> input <- get counter;
> if (stored <> input)
>  then set var value
>  else <nop>
> sleep 100;

Try 'return ()'

(if ... then ... else return ()); ...



More information about the Ur mailing list