Safe Haskell | Safe-Inferred |
---|---|

Language | Haskell98 |

- run :: RunBufferMode -> RunBufferMode -> IO a -> IO ()
- data RunBufferMode
- = RunNoBuffering
- | RunLineBuffering (Maybe Int)
- | RunBlockBuffering (Maybe Int) (Maybe Int)

- data Maybe a :: * -> *

# Documentation

run :: RunBufferMode -> RunBufferMode -> IO a -> IO () Source

data RunBufferMode Source

data Maybe a :: * -> *

The `Maybe`

type encapsulates an optional value. A value of type

either contains a value of type `Maybe`

a`a`

(represented as

),
or it is empty (represented as `Just`

a`Nothing`

). Using `Maybe`

is a good way to
deal with errors or exceptional cases without resorting to drastic
measures such as `error`

.

The `Maybe`

type is also a monad. It is a simple kind of error
monad, where all errors are represented by `Nothing`

. A richer
error monad can be built using the `Either`

type.