import "Prelude" @private repeat :: Integer -> (() -> a) -> () repeat n proc = if n > 0 then do proc () repeat (n-1) proc else () main = do a = ref 1 repeat 3 (\() -> a := 2) getRef a -- 2