-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | 2D text pretty-printing library
--   
--   A pretty-printing library for laying out text in two dimensions, using
--   a simple box model.
@package boxes
@version 0.1.4


-- | A pretty-printing library for laying out text in two dimensions, using
--   a simple box model.
module Text.PrettyPrint.Boxes

-- | The basic data type. A box has a specified size and some sort of
--   contents.
data Box

-- | The null box, which has no content and no size. It is quite useless.
nullBox :: Box

-- | <tt>emptyBox r c</tt> is an empty box with <tt>r</tt> rows and
--   <tt>c</tt> columns. Useful for effecting more fine-grained positioning
--   of other boxes, by inserting empty boxes of the desired size in
--   between them.
emptyBox :: Int -> Int -> Box

-- | A <tt>1x1</tt> box containing a single character.
char :: Char -> Box

-- | A (<tt>1 x len</tt>) box containing a string of length <tt>len</tt>.
text :: String -> Box

-- | <tt>para algn w t</tt> is a box of width <tt>w</tt>, containing text
--   <tt>t</tt>, aligned according to <tt>algn</tt>, flowed to fit within
--   the given width.
para :: Alignment -> Int -> String -> Box

-- | <tt>columns w h t</tt> is a list of boxes, each of width <tt>w</tt>
--   and height at most <tt>h</tt>, containing text <tt>t</tt> flowed into
--   as many columns as necessary.
columns :: Alignment -> Int -> Int -> String -> [Box]

-- | Paste two boxes together horizontally, using a default (top)
--   alignment.
(<>) :: Box -> Box -> Box

-- | Paste two boxes together horizontally with a single intervening column
--   of space, using a default (top) alignment.
(<+>) :: Box -> Box -> Box

-- | Glue a list of boxes together horizontally, with the given alignment.
hcat :: Alignment -> [Box] -> Box

-- | <tt>hsep sep a bs</tt> lays out <tt>bs</tt> horizontally with
--   alignment <tt>a</tt>, with <tt>sep</tt> amount of space in between
--   each.
hsep :: Int -> Alignment -> [Box] -> Box

-- | Paste two boxes together vertically, using a default (left) alignment.
(//) :: Box -> Box -> Box

-- | Paste two boxes together vertically with a single intervening row of
--   space, using a default (left) alignment.
(/+/) :: Box -> Box -> Box

-- | Glue a list of boxes together vertically, with the given alignment.
vcat :: Alignment -> [Box] -> Box

-- | <tt>vsep sep a bs</tt> lays out <tt>bs</tt> vertically with alignment
--   <tt>a</tt>, with <tt>sep</tt> amount of space in between each.
vsep :: Int -> Alignment -> [Box] -> Box

-- | <tt>punctuateH a p bs</tt> horizontally lays out the boxes <tt>bs</tt>
--   with a copy of <tt>p</tt> interspersed between each.
punctuateH :: Alignment -> Box -> [Box] -> Box

-- | A vertical version of <a>punctuateH</a>.
punctuateV :: Alignment -> Box -> [Box] -> Box

-- | Data type for specifying the alignment of boxes.
data Alignment

-- | Align boxes to the left.
left :: Alignment

-- | Align boxes to the right.
right :: Alignment

-- | Align boxes along their tops.
top :: Alignment

-- | Align boxes along their bottoms.
bottom :: Alignment

-- | Align boxes centered, but biased to the left/top in case of unequal
--   parities.
center1 :: Alignment

-- | Align boxes centered, but biased to the right/bottom in case of
--   unequal parities.
center2 :: Alignment

-- | Move a box left by putting it in a larger box with extra columns,
--   aligned left. Note that the name of this function is something of a
--   white lie, as this will only result in the box being moved left by the
--   specified amount if it is already in a larger right-aligned context.
moveLeft :: Int -> Box -> Box

-- | Move a box right by putting it in a larger box with extra columns,
--   aligned right. See the disclaimer for <a>moveLeft</a>.
moveRight :: Int -> Box -> Box

-- | Move a box "up" by putting it in a larger box with extra rows, aligned
--   to the top. See the disclaimer for <a>moveLeft</a>.
moveUp :: Int -> Box -> Box

-- | Move a box down by putting it in a larger box with extra rows, aligned
--   to the bottom. See the disclaimer for <a>moveLeft</a>.
moveDown :: Int -> Box -> Box

-- | <tt>alignHoriz algn n bx</tt> creates a box of width <tt>n</tt>, with
--   the contents and height of <tt>bx</tt>, horizontally aligned according
--   to <tt>algn</tt>.
alignHoriz :: Alignment -> Int -> Box -> Box

-- | <tt>alignVert algn n bx</tt> creates a box of height <tt>n</tt>, with
--   the contents and width of <tt>bx</tt>, vertically aligned according to
--   <tt>algn</tt>.
alignVert :: Alignment -> Int -> Box -> Box

-- | <tt>align ah av r c bx</tt> creates an <tt>r</tt> x <tt>c</tt> box
--   with the contents of <tt>bx</tt>, aligned horizontally according to
--   <tt>ah</tt> and vertically according to <tt>av</tt>.
align :: Alignment -> Alignment -> Int -> Int -> Box -> Box
rows :: Box -> Int
cols :: Box -> Int

-- | Render a <a>Box</a> as a String, suitable for writing to the screen or
--   a file.
render :: Box -> String

-- | A convenience function for rendering a box to stdout.
printBox :: Box -> IO ()
instance GHC.Show.Show Text.PrettyPrint.Boxes.Box
instance GHC.Show.Show Text.PrettyPrint.Boxes.Content
instance GHC.Show.Show Text.PrettyPrint.Boxes.Alignment
instance GHC.Read.Read Text.PrettyPrint.Boxes.Alignment
instance GHC.Classes.Eq Text.PrettyPrint.Boxes.Alignment
instance Data.String.IsString Text.PrettyPrint.Boxes.Box
