Go to the first, previous, next, last section, table of contents.

Avoiding monads

The `_ccall_' construct is part of the `PrimIO' monad because 9 out of 10 uses will be to call imperative functions with side effects such as `printf'. Use of the monad ensures that these operations happen in a predictable order in spite of laziness and compiler optimisations.

There are three situations where one might like to use `unsafePerformPrimIO' to avoid the monad:


Go to the first, previous, next, last section, table of contents.