view timer.ur @ 32:d32fb0f7b137

Update for Ur/Web's new type class handling
author Adam Chlipala <adam@chlipala.net>
date Sun, 29 Jul 2012 12:28:46 -0400
parents 37eefd0a2ed4
children
line wrap: on
line source
type t = source bool

fun create r =
    b <- source False;
    spawn (sleep r.Milliseconds;
           b <- get b;
           if b then
               return ()
           else
               r.Action);
    return b

fun cancel b = set b True