Output a thousand Sussmen in an individualistic way.
Name:
Anonymous2009-08-22 10:16
import Data.IORef
foreach = flip mapM_
while test action = do
val <- test
if val then do {action;while test action}
else return ()
incr ref = modifyIORef ref (+1)
test ref f = do { val <- readIORef ref; return (f val) }
main = do
foreach [1..0] print
ref <- newIORef 0
while (test ref (< 1000))
(do
print "Sussman"
incr ref)