IO Bool -> Bool

Ashley Yakeley
Sun, 24 Aug 2003 05:12:48 -0700

In article <>,
 "Tn X-10n" <> wrote:

> is it possible to convert IO Bool to Bool?

Not directly in Haskell, but you can use the "<-" syntax to do something 
vaguely similar inside a "do" block. For instance:

  foo :: IO Bool

    result <- foo
    if result then putStrLn "yes" else return ()

Here "result" has type Bool. "do" blocks are magic conjured from sugar 
and syntax.

Ashley Yakeley, Seattle WA