Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | Stephen Tetley <stephen.tetley@gmail.com> |
Build relative paths monadically.
** WARNING ** this module is an experiment, and may change significantly or even be dropped from future revisions.
- class Monad m => LocTraceM m where
- data PathSpec u a
- data PathSpecT u m a
- data Vamp u
- data PathTerm
- makeVamp :: Vec2 u -> RelPath u -> PathTerm -> Vamp u
- runPathSpec :: (Floating u, InterpretUnit u) => PathSpec u a -> (a, RelPath u, Vec2 u, LocGraphic u, LocGraphic u)
- execPathSpec :: (Floating u, InterpretUnit u) => PathSpec u a -> LocGraphic u
- evalPathSpec :: (Floating u, InterpretUnit u) => PathSpec u a -> RelPath u
- runPathSpecT :: (Monad m, Floating u, InterpretUnit u) => PathSpecT u m a -> m (a, RelPath u, Vec2 u, LocGraphic u, LocGraphic u)
- execPathSpecT :: (Monad m, Floating u, InterpretUnit u) => PathSpecT u m a -> m (LocGraphic u)
- evalPathSpecT :: (Monad m, Floating u, InterpretUnit u) => PathSpecT u m a -> m (RelPath u)
- execPivot :: (Floating u, InterpretUnit u) => PathSpec u a -> PathSpec u a -> LocGraphic u
- execPivotT :: (Floating u, InterpretUnit u, Monad m) => PathSpecT u m a -> PathSpecT u m a -> m (LocGraphic u)
- class Monad m => PathOpM m where
- pen_colour :: PathOpM m => RGBi -> m ()
- pen_width :: PathOpM m => Double -> m ()
- lines :: (PathOpM m, u ~ MonUnit (m ())) => [Vec2 u] -> m ()
- hline :: (PathOpM m, Num u, u ~ MonUnit (m ())) => u -> m ()
- vline :: (PathOpM m, Num u, u ~ MonUnit (m ())) => u -> m ()
- aline :: (PathOpM m, Floating u, u ~ MonUnit (m ())) => Radian -> u -> m ()
Documentation
class Monad m => LocTraceM m whereSource
insertl
analogue to Writer monad tell
.
runPathSpec :: (Floating u, InterpretUnit u) => PathSpec u a -> (a, RelPath u, Vec2 u, LocGraphic u, LocGraphic u)Source
Run a PathSpec - return a five-tuple.
(ans, path, end_vector, pen_trace, insert_trace)
ans - is the monadic answer, usually ().
path - is the relative path formed by all movements during the build. This includes movement where the pen is _up_.
end_vector - is the cumulative displacement from the start point.
pen_trace - is ...
insert_trace -
execPathSpec :: (Floating u, InterpretUnit u) => PathSpec u a -> LocGraphic uSource
Run an PathSpec
- return the LocGraphic formed by the pen
trace and the insert trace, forget the outline of the path.
Note - the insert trace is printed above the pen trace in the z-order.
evalPathSpec :: (Floating u, InterpretUnit u) => PathSpec u a -> RelPath uSource
Run an PathSpec
- return the outline of the path, forget
the the pen trace and the insert trace.
runPathSpecT :: (Monad m, Floating u, InterpretUnit u) => PathSpecT u m a -> m (a, RelPath u, Vec2 u, LocGraphic u, LocGraphic u)Source
Transformer version of runPathSpec
execPathSpecT :: (Monad m, Floating u, InterpretUnit u) => PathSpecT u m a -> m (LocGraphic u)Source
Transformer version of execPathSpec
evalPathSpecT :: (Monad m, Floating u, InterpretUnit u) => PathSpecT u m a -> m (RelPath u)Source
Transformer version of evalPathSpec
.
execPivot :: (Floating u, InterpretUnit u) => PathSpec u a -> PathSpec u a -> LocGraphic uSource
Form a "pivot path" drawing from two path specifications. The start point of the drawing is the pivot formed by joining the paths.
execPivotT :: (Floating u, InterpretUnit u, Monad m) => PathSpecT u m a -> PathSpecT u m a -> m (LocGraphic u)Source
Transformer version of execPivot
.
class Monad m => PathOpM m whereSource
updatePen
will draw any in-progress path as an open-stroked
line before changing the pen properties.
Derived operators
pen_colour :: PathOpM m => RGBi -> m ()Source