Safe Haskell | None |
---|
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.
- module Graphics.Web.Processing.Core.Types
- data ProcM c a
- runProcM :: ProcM c a -> (a, ProcCode c)
- execProcM :: ProcM c a -> ProcCode c
- module Graphics.Web.Processing.Core.Var
- module Graphics.Web.Processing.Core.Interface
Types
Monad
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.
ProcMonad ProcM | When using this instance, please, be aware of the
behavior of 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