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

Safe HaskellNone
LanguageHaskell98

Diagrams.Puzzles.Lib

Synopsis

Documentation

vline :: Backend' b => Double -> Diagram b R2 Source

Vertical/horizontal stroked line of given length.

hline :: Backend' 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 => 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 -> [Diagram b R2] -> Diagram b R2 Source

Spread diagrams evenly along the given vector.

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

besidesL :: (Backend' b, Semigroup m, Monoid m) => 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 :: (Backend' b, Semigroup m, Monoid m) => 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' :: Backend' b => 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 => Diagram b R2 -> Diagram b R2 Source

Variant of phantom that forces the argument backend type.