Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | stephen.tetley@gmail.com |
Writer monad with imperative turtle style movement to build LocGraphics.
- data LocTrace u a
- data LocTraceT u m a
- runLocTrace :: Num u => LocTrace u a -> (a, Vec2 u, LocGraphic u)
- evalLocTrace :: Num u => LocTrace u a -> a
- execLocTrace :: Num u => LocTrace u a -> LocGraphic u
- runLocTraceT :: (Monad m, Num u) => LocTraceT u m a -> m (a, Vec2 u, LocGraphic u)
- evalLocTraceT :: (Monad m, Num u) => LocTraceT u m a -> m a
- execLocTraceT :: (Monad m, Num u) => LocTraceT u m a -> m (LocGraphic u)
- liftLocTraceT :: Monad m => m a -> LocTraceT u m a
- class Monad m => LocTraceM m where
- class LocTraceM m => LocForkTraceM m where
- hmoveBy :: (LocTraceM m, Num u, u ~ MonUnit (m ())) => u -> m ()
- vmoveBy :: (LocTraceM m, Num u, u ~ MonUnit (m ())) => u -> m ()
LocTrace monads
LocTrace is a writer state monad.
The writer accumulates a LocGraphic the state is a cumulative displacement vector (called a cursor below).
LocTrace is a writer state monad.
The writer accumulates a LocGraphic the state is a cumulative displacement vector.
runLocTrace :: Num u => LocTrace u a -> (a, Vec2 u, LocGraphic u)Source
evalLocTrace :: Num u => LocTrace u a -> aSource
Forget the generated LocImage, just return the answer.
execLocTrace :: Num u => LocTrace u a -> LocGraphic uSource
Forget the answer, just return the generated LocImage.
runLocTraceT :: (Monad m, Num u) => LocTraceT u m a -> m (a, Vec2 u, LocGraphic u)Source
evalLocTraceT :: (Monad m, Num u) => LocTraceT u m a -> m aSource
Forget the generated LocImage, just return the answer.
execLocTraceT :: (Monad m, Num u) => LocTraceT u m a -> m (LocGraphic u)Source
Forget the answer, just return the generated LocImage.
liftLocTraceT :: Monad m => m a -> LocTraceT u m aSource
LocTrace classes
class Monad m => LocTraceM m whereSource
insertl
analogue to Writer monad tell
.
class LocTraceM m => LocForkTraceM m whereSource
Add operations for branching (fork at the current point) and resetting to the start point.
Not all drawings that support tracing support branching. For instance Paths can be built by tracing but they always need a cumulative progression of next point they cannot resrt to the start point and go in a differnt direction.
Num u => LocForkTraceM (LocTrace u) | |
(LocTraceM m, Num u) => LocForkTraceM (LocTraceT u m) |