[Ur] how to use conditions in monads?

Gergely Buday gbuday at gmail.com
Mon Sep 5 07:16:02 EDT 2011


> stored <- get store;
> input <- get counter;
> if (stored <> input)
>  then set var value
>  else <nop>
> sleep 100;

Vladimir wrote:

> Try 'return ()'
>
> (if ... then ... else return ()); ...

If I understand correctly, I can use return only at the end of a monad
chain, can't I?

- Gergely



More information about the Ur mailing list