-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Common drawing utilities built on wumpus-core.
--
-- Very preliminary release...
--
-- Changelog:
--
-- 0.1.1 to 0.2.0:
--
--
-- - Added the module Wumpus.Basic.Graphic.
-- - SafeFonts changed to be size neutral. PostScript's
-- scalefont command (which wumpus-core uses in the generated
-- output) should be able to scale to any integer size.
-- - New demo ColourCharts.hs.
--
@package wumpus-basic
@version 0.2.0
-- | Version number
module Wumpus.Basic.VersionNumber
wumpus_basic_version :: (Int, Int, Int)
-- | The X11 'named colours', as rgb [0,1] values
module Wumpus.Basic.X11Colours
antiqueWhite1 :: DRGB
antiqueWhite2 :: DRGB
antiqueWhite3 :: DRGB
antiqueWhite4 :: DRGB
aquamarine1 :: DRGB
aquamarine2 :: DRGB
aquamarine3 :: DRGB
aquamarine4 :: DRGB
azure1 :: DRGB
azure2 :: DRGB
azure3 :: DRGB
azure4 :: DRGB
bisque1 :: DRGB
bisque2 :: DRGB
bisque3 :: DRGB
bisque4 :: DRGB
blue1 :: DRGB
blue2 :: DRGB
blue3 :: DRGB
blue4 :: DRGB
brown1 :: DRGB
brown2 :: DRGB
brown3 :: DRGB
brown4 :: DRGB
burlywood1 :: DRGB
burlywood2 :: DRGB
burlywood3 :: DRGB
burlywood4 :: DRGB
cadetBlue1 :: DRGB
cadetBlue2 :: DRGB
cadetBlue3 :: DRGB
cadetBlue4 :: DRGB
chartreuse1 :: DRGB
chartreuse2 :: DRGB
chartreuse3 :: DRGB
chartreuse4 :: DRGB
chocolate1 :: DRGB
chocolate2 :: DRGB
chocolate3 :: DRGB
chocolate4 :: DRGB
coral1 :: DRGB
coral2 :: DRGB
coral3 :: DRGB
coral4 :: DRGB
cornsilk1 :: DRGB
cornsilk2 :: DRGB
cornsilk3 :: DRGB
cornsilk4 :: DRGB
cyan1 :: DRGB
cyan2 :: DRGB
cyan3 :: DRGB
cyan4 :: DRGB
darkGoldenrod1 :: DRGB
darkGoldenrod2 :: DRGB
darkGoldenrod3 :: DRGB
darkGoldenrod4 :: DRGB
darkOliveGreen1 :: DRGB
darkOliveGreen2 :: DRGB
darkOliveGreen3 :: DRGB
darkOliveGreen4 :: DRGB
darkOrange1 :: DRGB
darkOrange2 :: DRGB
darkOrange3 :: DRGB
darkOrange4 :: DRGB
darkOrchid1 :: DRGB
darkOrchid2 :: DRGB
darkOrchid3 :: DRGB
darkOrchid4 :: DRGB
darkSeaGreen1 :: DRGB
darkSeaGreen2 :: DRGB
darkSeaGreen3 :: DRGB
darkSeaGreen4 :: DRGB
darkSlateGray1 :: DRGB
darkSlateGray2 :: DRGB
darkSlateGray3 :: DRGB
darkSlateGray4 :: DRGB
deepPink1 :: DRGB
deepPink2 :: DRGB
deepPink3 :: DRGB
deepPink4 :: DRGB
deepSkyBlue1 :: DRGB
deepSkyBlue2 :: DRGB
deepSkyBlue3 :: DRGB
deepSkyBlue4 :: DRGB
dodgerBlue1 :: DRGB
dodgerBlue2 :: DRGB
dodgerBlue3 :: DRGB
dodgerBlue4 :: DRGB
firebrick1 :: DRGB
firebrick2 :: DRGB
firebrick3 :: DRGB
firebrick4 :: DRGB
gold1 :: DRGB
gold2 :: DRGB
gold3 :: DRGB
gold4 :: DRGB
goldenrod1 :: DRGB
goldenrod2 :: DRGB
goldenrod3 :: DRGB
goldenrod4 :: DRGB
green1 :: DRGB
green2 :: DRGB
green3 :: DRGB
green4 :: DRGB
honeydew1 :: DRGB
honeydew2 :: DRGB
honeydew3 :: DRGB
honeydew4 :: DRGB
hotPink1 :: DRGB
hotPink2 :: DRGB
hotPink3 :: DRGB
hotPink4 :: DRGB
indianRed1 :: DRGB
indianRed2 :: DRGB
indianRed3 :: DRGB
indianRed4 :: DRGB
ivory1 :: DRGB
ivory2 :: DRGB
ivory3 :: DRGB
ivory4 :: DRGB
khaki1 :: DRGB
khaki2 :: DRGB
khaki3 :: DRGB
khaki4 :: DRGB
lavenderBlush1 :: DRGB
lavenderBlush2 :: DRGB
lavenderBlush3 :: DRGB
lavenderBlush4 :: DRGB
lemonChiffon1 :: DRGB
lemonChiffon2 :: DRGB
lemonChiffon3 :: DRGB
lemonChiffon4 :: DRGB
lightBlue1 :: DRGB
lightBlue2 :: DRGB
lightBlue3 :: DRGB
lightBlue4 :: DRGB
lightCyan1 :: DRGB
lightCyan2 :: DRGB
lightCyan3 :: DRGB
lightCyan4 :: DRGB
lightGoldenrod1 :: DRGB
lightGoldenrod2 :: DRGB
lightGoldenrod3 :: DRGB
lightGoldenrod4 :: DRGB
lightPink1 :: DRGB
lightPink2 :: DRGB
lightPink3 :: DRGB
lightPink4 :: DRGB
lightSalmon1 :: DRGB
lightSalmon2 :: DRGB
lightSalmon3 :: DRGB
lightSalmon4 :: DRGB
lightSkyBlue1 :: DRGB
lightSkyBlue2 :: DRGB
lightSkyBlue3 :: DRGB
lightSkyBlue4 :: DRGB
lightSteelBlue1 :: DRGB
lightSteelBlue2 :: DRGB
lightSteelBlue3 :: DRGB
lightSteelBlue4 :: DRGB
lightYellow1 :: DRGB
lightYellow2 :: DRGB
lightYellow3 :: DRGB
lightYellow4 :: DRGB
magenta1 :: DRGB
magenta2 :: DRGB
magenta3 :: DRGB
magenta4 :: DRGB
maroon1 :: DRGB
maroon2 :: DRGB
maroon3 :: DRGB
maroon4 :: DRGB
mediumOrchid1 :: DRGB
mediumOrchid2 :: DRGB
mediumOrchid3 :: DRGB
mediumOrchid4 :: DRGB
mediumPurple1 :: DRGB
mediumPurple2 :: DRGB
mediumPurple3 :: DRGB
mediumPurple4 :: DRGB
mistyRose1 :: DRGB
mistyRose2 :: DRGB
mistyRose3 :: DRGB
mistyRose4 :: DRGB
navajoWhite1 :: DRGB
navajoWhite2 :: DRGB
navajoWhite3 :: DRGB
navajoWhite4 :: DRGB
oliveDrab1 :: DRGB
oliveDrab2 :: DRGB
oliveDrab3 :: DRGB
oliveDrab4 :: DRGB
orange1 :: DRGB
orange2 :: DRGB
orange3 :: DRGB
orange4 :: DRGB
orangeRed1 :: DRGB
orangeRed2 :: DRGB
orangeRed3 :: DRGB
orangeRed4 :: DRGB
orchid1 :: DRGB
orchid2 :: DRGB
orchid3 :: DRGB
orchid4 :: DRGB
paleGreen1 :: DRGB
paleGreen2 :: DRGB
paleGreen3 :: DRGB
paleGreen4 :: DRGB
paleTurquoise1 :: DRGB
paleTurquoise2 :: DRGB
paleTurquoise3 :: DRGB
paleTurquoise4 :: DRGB
paleVioletRed1 :: DRGB
paleVioletRed2 :: DRGB
paleVioletRed3 :: DRGB
paleVioletRed4 :: DRGB
peachPuff1 :: DRGB
peachPuff2 :: DRGB
peachPuff3 :: DRGB
peachPuff4 :: DRGB
pink1 :: DRGB
pink2 :: DRGB
pink3 :: DRGB
pink4 :: DRGB
plum1 :: DRGB
plum2 :: DRGB
plum3 :: DRGB
plum4 :: DRGB
purple1 :: DRGB
purple2 :: DRGB
purple3 :: DRGB
purple4 :: DRGB
red1 :: DRGB
red2 :: DRGB
red3 :: DRGB
red4 :: DRGB
rosyBrown1 :: DRGB
rosyBrown2 :: DRGB
rosyBrown3 :: DRGB
rosyBrown4 :: DRGB
royalBlue1 :: DRGB
royalBlue2 :: DRGB
royalBlue3 :: DRGB
royalBlue4 :: DRGB
salmon1 :: DRGB
salmon2 :: DRGB
salmon3 :: DRGB
salmon4 :: DRGB
seaGreen1 :: DRGB
seaGreen2 :: DRGB
seaGreen3 :: DRGB
seaGreen4 :: DRGB
seashell1 :: DRGB
seashell2 :: DRGB
seashell3 :: DRGB
seashell4 :: DRGB
sienna1 :: DRGB
sienna2 :: DRGB
sienna3 :: DRGB
sienna4 :: DRGB
skyBlue1 :: DRGB
skyBlue2 :: DRGB
skyBlue3 :: DRGB
skyBlue4 :: DRGB
slateBlue1 :: DRGB
slateBlue2 :: DRGB
slateBlue3 :: DRGB
slateBlue4 :: DRGB
slateGray1 :: DRGB
slateGray2 :: DRGB
slateGray3 :: DRGB
slateGray4 :: DRGB
snow1 :: DRGB
snow2 :: DRGB
snow3 :: DRGB
snow4 :: DRGB
springGreen1 :: DRGB
springGreen2 :: DRGB
springGreen3 :: DRGB
springGreen4 :: DRGB
steelBlue1 :: DRGB
steelBlue2 :: DRGB
steelBlue3 :: DRGB
steelBlue4 :: DRGB
tan1 :: DRGB
tan2 :: DRGB
tan3 :: DRGB
tan4 :: DRGB
thistle1 :: DRGB
thistle2 :: DRGB
thistle3 :: DRGB
thistle4 :: DRGB
tomato1 :: DRGB
tomato2 :: DRGB
tomato3 :: DRGB
tomato4 :: DRGB
turquoise1 :: DRGB
turquoise2 :: DRGB
turquoise3 :: DRGB
turquoise4 :: DRGB
violetRed1 :: DRGB
violetRed2 :: DRGB
violetRed3 :: DRGB
violetRed4 :: DRGB
wheat1 :: DRGB
wheat2 :: DRGB
wheat3 :: DRGB
wheat4 :: DRGB
yellow1 :: DRGB
yellow2 :: DRGB
yellow3 :: DRGB
yellow4 :: DRGB
gray0 :: DRGB
green0 :: DRGB
grey0 :: DRGB
maroon0 :: DRGB
purple0 :: DRGB
-- | The SVG 'named colours', as rgb [0,1] values
module Wumpus.Basic.SVGColours
aliceBlue :: DRGB
antiqueWhite :: DRGB
aqua :: DRGB
aquamarine :: DRGB
azure :: DRGB
beige :: DRGB
bisque :: DRGB
black :: DRGB
blanchedAlmond :: DRGB
blue :: DRGB
blueViolet :: DRGB
brown :: DRGB
burlywood :: DRGB
cadetBlue :: DRGB
chartreuse :: DRGB
chocolate :: DRGB
coral :: DRGB
cornflowerBlue :: DRGB
cornsilk :: DRGB
crimson :: DRGB
cyan :: DRGB
darkBlue :: DRGB
darkCyan :: DRGB
darkGoldenrod :: DRGB
darkGray :: DRGB
darkGreen :: DRGB
darkGrey :: DRGB
darkKhaki :: DRGB
darkMagenta :: DRGB
darkOliveGreen :: DRGB
darkOrange :: DRGB
darkOrchid :: DRGB
darkRed :: DRGB
darkSalmon :: DRGB
darkSeaGreen :: DRGB
darkSlateBlue :: DRGB
darkSlateGray :: DRGB
darkSlateGrey :: DRGB
darkTurquoise :: DRGB
darkViolet :: DRGB
deepPink :: DRGB
deepSkyBlue :: DRGB
dimGray :: DRGB
dimGrey :: DRGB
dodgerBlue :: DRGB
firebrick :: DRGB
floralWhite :: DRGB
forestGreen :: DRGB
fuchsia :: DRGB
gainsboro :: DRGB
ghostWhite :: DRGB
gold :: DRGB
goldenrod :: DRGB
gray :: DRGB
grey :: DRGB
green :: DRGB
greenYellow :: DRGB
honeydew :: DRGB
hotPink :: DRGB
indianRed :: DRGB
indigo :: DRGB
ivory :: DRGB
khaki :: DRGB
lavender :: DRGB
lavenderBlush :: DRGB
lawnGreen :: DRGB
lemonChiffon :: DRGB
lightBlue :: DRGB
lightCoral :: DRGB
lightCyan :: DRGB
lightGoldenrodYellow :: DRGB
lightGray :: DRGB
lightGreen :: DRGB
lightGrey :: DRGB
lightPink :: DRGB
lightSalmon :: DRGB
lightSeaGreen :: DRGB
lightSkyBlue :: DRGB
lightSlateGray :: DRGB
lightSlateGrey :: DRGB
lightSteelBlue :: DRGB
lightYellow :: DRGB
lime :: DRGB
limeGreen :: DRGB
linen :: DRGB
magenta :: DRGB
maroon :: DRGB
mediumAquamarine :: DRGB
mediumBlue :: DRGB
mediumOrchid :: DRGB
mediumPurple :: DRGB
mediumSeaGreen :: DRGB
mediumSlateBlue :: DRGB
mediumSpringGreen :: DRGB
mediumTurquoise :: DRGB
mediumVioletRed :: DRGB
midnightBlue :: DRGB
mintcream :: DRGB
mistyrose :: DRGB
moccasin :: DRGB
navajoWhite :: DRGB
navy :: DRGB
oldlace :: DRGB
olive :: DRGB
oliveDrab :: DRGB
orange :: DRGB
orangeRed :: DRGB
orchid :: DRGB
paleGoldenrod :: DRGB
paleGreen :: DRGB
paleTurquoise :: DRGB
paleVioletRed :: DRGB
papayawhip :: DRGB
peachpuff :: DRGB
peru :: DRGB
pink :: DRGB
plum :: DRGB
powderBlue :: DRGB
purple :: DRGB
red :: DRGB
rosyBrown :: DRGB
royalBlue :: DRGB
saddleBrown :: DRGB
salmon :: DRGB
sandyBrown :: DRGB
seaGreen :: DRGB
seashell :: DRGB
sienna :: DRGB
silver :: DRGB
skyBlue :: DRGB
slateBlue :: DRGB
slateGray :: DRGB
slateGrey :: DRGB
snow :: DRGB
springGreen :: DRGB
steelBlue :: DRGB
tan :: DRGB
teal :: DRGB
thistle :: DRGB
tomato :: DRGB
turquoise :: DRGB
violet :: DRGB
wheat :: DRGB
white :: DRGB
whitesmoke :: DRGB
yellow :: DRGB
yellowGreen :: DRGB
-- | Safe to use fonts.
module Wumpus.Basic.SafeFonts
timesRoman :: Int -> FontAttr
timesItalic :: Int -> FontAttr
timesBold :: Int -> FontAttr
timesBoldItalic :: Int -> FontAttr
helvetica :: Int -> FontAttr
helveticaOblique :: Int -> FontAttr
helveticaBold :: Int -> FontAttr
helveticaBoldOblique :: Int -> FontAttr
courier :: Int -> FontAttr
courierOblique :: Int -> FontAttr
courierBold :: Int -> FontAttr
courierBoldOblique :: Int -> FontAttr
symbol :: Int -> FontAttr
-- | Turtle monad and monad transformer.
--
-- The Turtle monad embodies the LOGO style of imperative drawing -
-- sending commands to update the a cursor.
--
-- While Wumpus generally aims for a more compositional,
-- "coordinate-free" style of drawing, some types of diagram are very
-- easily expressed in the LOGO style.
module Wumpus.Basic.Monads.TurtleMonad
data Coord
Coord :: !Int -> !Int -> Coord
data Turtle a
data TurtleT m a
class (Monad m) => TurtleM m
getLoc :: (TurtleM m) => m Coord
setLoc :: (TurtleM m) => Coord -> m ()
runTurtle :: Turtle a -> (a, (Int, Int))
runTurtleT :: (Monad m) => TurtleT m a -> m (a, (Int, Int))
setsLoc :: (TurtleM m) => (Coord -> (a, Coord)) -> m a
setsLoc_ :: (TurtleM m) => (Coord -> Coord) -> m ()
reset :: (TurtleM m) => m ()
moveLeft :: (TurtleM m) => m ()
moveRight :: (TurtleM m) => m ()
moveUp :: (TurtleM m) => m ()
moveDown :: (TurtleM m) => m ()
nextLine :: (TurtleM m) => m ()
-- | No longer sure about this combinator...
wander :: (TurtleM m) => m a -> m (a, Coord, Coord)
instance (Monad m) => TurtleM (TurtleT m)
instance TurtleM Turtle
instance MonadT TurtleT
instance (Monad m) => Monad (TurtleT m)
instance Monad Turtle
instance (Monad m) => Applicative (TurtleT m)
instance Applicative Turtle
instance (Monad m) => Functor (TurtleT m)
instance Functor Turtle
instance Show Coord
-- | Hughes list, ...
module Wumpus.Basic.Utils.HList
type H a = [a] -> [a]
emptyH :: H a
wrapH :: a -> H a
consH :: a -> H a -> H a
snocH :: H a -> a -> H a
appendH :: H a -> H a -> H a
unfoldrH :: (b -> Maybe (a, b)) -> b -> H a
-- | velo consumes the list as per map, but builds it back as a Hughes list
-- - so items can be dropped replaced, repeated, etc...
veloH :: (a -> H b) -> [a] -> H b
concatH :: [H a] -> H a
toListH :: H a -> [a]
fromListH :: [a] -> H a
-- | "Trace" monad and monad transformer.
--
-- Trace is operationally similar to the Writer monad but it supports
-- elementary consing as well as the Writer's monoidal concatenation.
--
-- Note, some care is needed to order the output to a trace with respect
-- to the Z-order of a drawing. The API here may well be too limited...
module Wumpus.Basic.Monads.TraceMonad
data Trace i a
data TraceT i m a
class TraceM m i | m -> i
trace :: (TraceM m i) => H i -> m ()
trace1 :: (TraceM m i) => i -> m ()
runTrace :: Trace i a -> (a, H i)
runTraceT :: (Monad m) => TraceT i m a -> m (a, H i)
instance (Monad m) => TraceM (TraceT i m) i
instance TraceM (Trace i) i
instance MonadT (TraceT i)
instance (Monad m) => Monad (TraceT i m)
instance Monad (Trace i)
instance (Monad m) => Applicative (TraceT i m)
instance Applicative (Trace i)
instance (Monad m) => Functor (TraceT i m)
instance Functor (Trace i)
-- | Graphic type and opertations
--
--
-- - * WARNING ** this module is highly experimental, and may change
-- significantly or even be dropped from future revisions.
--
module Wumpus.Basic.Graphic
-- | Note - this representation allows for zero, one or more Primitives to
-- be collected together.
type Graphic u = H (Primitive u)
type DGraphic = Graphic Double
type GraphicF u = Point2 u -> Graphic u
type DGraphicF = GraphicF Double
cc :: (r1 -> a -> ans) -> (r1 -> r2 -> a) -> r1 -> r2 -> ans
-- | Note - a Picture cannot be empty whereas a Graphic can. Hence this
-- function returns via Maybe.
drawGraphic :: (Real u, Floating u) => Graphic u -> Maybe (Picture u)
-- | Lift a Primitive to a Graphic
wrapG :: Primitive u -> Graphic u
text :: (TextLabel t, Num u) => t -> String -> GraphicF u
straightLine :: (Stroke t, Num u) => t -> Vec2 u -> GraphicF u
-- | Point is bottom-left.
strokedRectangle :: (Stroke t, Num u) => t -> u -> u -> GraphicF u
-- | Point is bottom-left.
filledRectangle :: (Fill t, Num u) => t -> u -> u -> GraphicF u
circle :: (Ellipse t, Fractional u) => t -> u -> GraphicF u