processing-1.1.0.0: Web graphic applications with Processing.

Safe HaskellNone

Graphics.Web.Processing.Basic

Contents

Description

The basic interface is the closest to the original. Although it contains some variations too.

For several reasons, it is recommended to use the mid interface instead, which can be found in the Graphics.Web.Processing.Mid module.

Synopsis

Types

Monad

data ProcM c a Source

Processing script producer monad. The context c indicates the context of the underlying ProcCode. This context restricts the use of certain commands only to places where they are expected.

The commands that you can run under this monad are mostly defined in Graphics.Web.Processing.Interface.

Once you have all the commands you want, use runProcM or execProcM to generate the corresponding Processing code under the ProcCode type.

Instances

ProcMonad ProcM

When using this instance, please, be aware of the behavior of readVar.

It does not matter when read the variable. The result will always hold the last value asigned to the variable. For example, this code

 v <- newVar 10
 ten <- readVar v
 writeVar v 20
 point (10,ten)

will draw a point at (10,20).

Monad (ProcM c) 
Functor (ProcM c) 
Applicative (ProcM c) 

runProcM :: ProcM c a -> (a, ProcCode c)Source

Generate Processing code using the ProcM monad. The code output is reduced.

execProcM :: ProcM c a -> ProcCode cSource

Generate Processing code using the ProcM monad, discarding the final value.

 execProcM = snd . runProcM

Variables

Interface