HGL-3.2.0.5: A simple graphics library based on X11 or Win32

Copyright(c) Alastair Reid, 1999-2003
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerlibraries@haskell.org
Stabilityprovisional
Portabilitynon-portable (requires concurrency)
Safe HaskellNone
LanguageHaskell98

Graphics.HGL.Draw.Monad

Description

The Draw monad, with graphical objects as a special case.

Synopsis

Documentation

type Graphic = Draw ()

An abstract representation of an image.

data Draw a

Monad for sequential construction of images.

Instances

ioToDraw :: IO a -> Draw a

Embed an IO action in a drawing action.

bracket

Arguments

:: Draw a

a pre-operation, whose value is passed to the other two components.

-> (a -> Draw b)

a post-operation, to be performed on exit from the bracket, whether normal or by an exception.

-> (a -> Draw c)

the drawing action inside the bracket.

-> Draw c 

Wrap a drawing action in initialization and finalization actions.

bracket_

Arguments

:: Draw a

a pre-operation, whose value is passed to the other two components.

-> (a -> Draw b)

a post-operation, to be performed on exit from the bracket, whether normal or by an exception.

-> Draw c

the drawing action inside the bracket.

-> Draw c 

A variant of bracket in which the inner drawing action does not use the result of the pre-operation.