packages feed

contstuff-0.2.0: Test.hs

-- |
-- Module:     Main
-- Copyright:  (c) 2010 Ertugrul Soeylemez
-- License:    BSD3
-- Maintainer: Ertugrul Soeylemez <es@ertes.de>
-- Stability:  experimental
--
-- This is a test program to test the various monads found in the
-- contstuff library.

module Main where

import Control.ContStuff
import Text.Printf


main :: IO ()
main =
  evalContT $ do
    (x, begin) <- labelCC 0
    when (mod x 100000 == 0) . io $ do
      putStr (show x)
      putChar '\r'
    goto begin (x+1)