puzzle-draw-0.1.0.3: Creating graphics for pencil puzzles.

Safe HaskellNone
LanguageHaskell98

Diagrams.Puzzles.Lib

Synopsis

Documentation

vline :: Renderable (Path R2) b => Double -> Diagram b R2 Source

Vertical/horizontal stroked line of given length.

hline :: Renderable (Path R2) b => Double -> Diagram b R2 Source

Vertical/horizontal stroked line of given length.

hcatsep :: (Juxtaposable a, HasOrigin a, Monoid' a, V a ~ R2) => [a] -> a Source

Variant of hcat' that spreads with distance 1.

vcatsep :: (Juxtaposable a, HasOrigin a, Monoid' a, V a ~ R2) => [a] -> a Source

Variant of vcat' that spreads with distance 1, and stacks towards the top.

smash :: Backend b R2 => QDiagram b R2 Any -> QDiagram b R2 Any Source

Collapse the envelope to a point.

translatep :: (Transformable t, V t ~ R2) => (Int, Int) -> t -> t Source

Helper to translate by a point given as (Int, Int).

r2i :: (Int, Int) -> R2 Source

Convert pair of Int to vector.

p2i :: (Int, Int) -> P2 Source

Convert pair of Int to point.

mirror :: (Transformable t, V t ~ R2) => t -> t Source

interleave :: [a] -> [a] -> [a] Source

Interleave two lists.

spread :: Backend b R2 => R2 -> [Diagram b R2] -> Diagram b R2 Source

Spread diagrams evenly along the given vector.

dmid :: (Enveloped a, V a ~ R2) => a -> Double Source

besidesL :: (Semigroup m, Backend b R2, Monoid m, Renderable (Path R2) b) => QDiagram b R2 m -> QDiagram b R2 m -> QDiagram b R2 m Source

Place the second diagram to the right of the first, aligning both vertically. The origin is the origin of the left diagram.

besidesR :: (Semigroup m, Backend b R2, Monoid m, Renderable (Path R2) b) => QDiagram b R2 m -> QDiagram b R2 m -> QDiagram b R2 m Source

Variant of besidesL where the origin is that of the right diagram.

fit :: (Transformable t, Enveloped t, V t ~ R2) => Double -> t -> t Source

fit f a scales a to fit into a square of size f.

text' :: (Renderable (Path R2) b, Backend b R2) => String -> Diagram b R2 Source

Write text that is centered both vertically and horizontally and that has an envelope. Sized such that single capital characters fit nicely into a square of size 1.

phantom' :: Backend b R2 => D R2 -> Diagram b R2 Source

Variant of phantom that forces the argument backend type.