Portability | GHC |
---|---|

Stability | unstable |

Maintainer | stephen.tetley@gmail.com |

Generate points in an iterated chain.

** WARNING ** - unstable. Names are not so good, also
Wumpus-Basic has a `chain1`

operator...

- type Chain u = [Point2 u]
- type LocChain u = Point2 u -> Chain u
- unchain :: Int -> LocGraphic u -> Chain u -> TraceDrawing u ()
- zipchain :: [LocGraphic u] -> Chain u -> TraceDrawing u ()
- zipchainWith :: (a -> LocGraphic u) -> [a] -> Chain u -> TraceDrawing u ()
- unchainTD :: Int -> (Point2 u -> TraceDrawing u ()) -> Chain u -> TraceDrawing u ()
- zipchainTD :: [Point2 u -> TraceDrawing u ()] -> Chain u -> TraceDrawing u ()
- zipchainWithTD :: (a -> Point2 u -> TraceDrawing u ()) -> [a] -> Chain u -> TraceDrawing u ()

# Documentation

type Chain u = [Point2 u]Source

A `Chain`

is a list of points. The list is often expected to
be inifinte, but if it was a Stream it would loose the ability
to use list comprehensions.

type LocChain u = Point2 u -> Chain uSource

A LocChain is a function from a starting point to a `Chain`

.

unchain :: Int -> LocGraphic u -> Chain u -> TraceDrawing u ()Source

Note - commonly a `Chain`

may be infinite, so it is only
unrolled a finite number of times.

zipchain :: [LocGraphic u] -> Chain u -> TraceDrawing u ()Source

zipchainWith :: (a -> LocGraphic u) -> [a] -> Chain u -> TraceDrawing u ()Source

unchainTD :: Int -> (Point2 u -> TraceDrawing u ()) -> Chain u -> TraceDrawing u ()Source

Variant of `unchain`

where the drawing argument is a
`TraceDrawing`

not a `LocGraphic`

.

zipchainTD :: [Point2 u -> TraceDrawing u ()] -> Chain u -> TraceDrawing u ()Source

zipchainWithTD :: (a -> Point2 u -> TraceDrawing u ()) -> [a] -> Chain u -> TraceDrawing u ()Source