-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Configurable text rendering of trees.
--
-- Configurable text rendering of trees.
@package tree-render-text
@version 0.1.0.0
-- | Configurable text rendering of trees.
module Data.Tree.Render.Text
-- | Describes where a parent node is rendered, relative to its children.
data ParentLocation
ParentBeforeChildren :: ParentLocation
ParentAfterChildren :: ParentLocation
ParentBetweenChildren :: ParentLocation
-- | Describes the render order of a node's children.
data ChildOrder
FirstToLast :: ChildOrder
LastToFirst :: ChildOrder
-- | A part of a path along a rendered tree.
data BranchPath
-- | Describes a turn going up toward the left.
--
-- e.g. ╭─
BranchUp :: BranchPath
-- | Describes a turn going down toward the left.
--
-- e.g. ╰─
BranchDown :: BranchPath
-- | Describes a T-join of a path going up and down toward the left.
--
-- e.g. ├─
BranchJoin :: BranchPath
-- | Describes a path going up and down.
--
-- e.g. │
BranchContinue :: BranchPath
-- | Describes a part that does NOT contain a path piece.
--
-- e.g.
BranchEmpty :: BranchPath
-- | Renders a pretty printed tree within a monadic context.
renderTreeM :: Monad m => RenderOptionsM m string label -> Tree label -> m ()
-- | Options used for rendering a 'Tree label'.
data RenderOptionsM m string label
RenderOptions :: ParentLocation -> ChildOrder -> Int -> Bool -> (String -> string) -> (string -> m ()) -> (label -> string) -> (label -> string) -> (BranchPath -> string) -> RenderOptionsM m string label
-- | Controls where parent nodes are rendered.
[oParentLocation] :: RenderOptionsM m string label -> ParentLocation
-- | Controls the order a node's children are rendered.
[oChildOrder] :: RenderOptionsM m string label -> ChildOrder
-- | The amount of vertical spacing between nodes.
[oVerticalPad] :: RenderOptionsM m string label -> Int
-- | If True, a newline is prepended to the rendered output.
[oPrependNewLine] :: RenderOptionsM m string label -> Bool
-- | Promotes a String to a string.
[oFromString] :: RenderOptionsM m string label -> String -> string
-- | Writes a string.
[oWrite] :: RenderOptionsM m string label -> string -> m ()
-- | Shows a rootLabel.
[oShowNodeLabel] :: RenderOptionsM m string label -> label -> string
-- | Get the marker for a node. Although this takes as input a node's
-- label, this should not render the label itself.
--
-- The label is passed as an argument to allow things such as: *
-- Rendering a node marker differently for labels that fail to pass a
-- test. * Highlighting a node currently being visited.
--
-- Simple use cases would use a constant function ignoring the label
-- value.
[oGetNodeMarker] :: RenderOptionsM m string label -> label -> string
-- | Shows a BranchPath. The returned values should contain no
-- newlines and should all be of the same printed width when rendered as
-- text.
[oShowBranchPath] :: RenderOptionsM m string label -> BranchPath -> string
-- | Options for producing a line-traced tree using unicode drawing
-- characters.
--
-- This uses: BranchUp -> "╭─" BranchDown -> "╰─" BranchJoin ->
-- "├─" BranchContinue -> "│ " BranchEmpty -> " "
tracedRenderOptionsM :: (String -> string) -> (string -> m ()) -> (label -> string) -> RenderOptionsM m string label
-- | Options for producing a line-traced tree using ASCII characters.
--
-- This uses: BranchUp -> ",-" BranchDown -> "`-" BranchJoin ->
-- "|-" BranchContinue -> "| " BranchEmpty -> " "
tracedRenderOptionsAsciiM :: (String -> string) -> (string -> m ()) -> (label -> string) -> RenderOptionsM m string label
-- | Renders a Tree a pretty printed tree asa a String.
renderTree :: RenderOptions String label -> Tree label -> String
-- | An alias of RenderOptionsM for producing pure String
-- renders.
type RenderOptions = RenderOptionsM (Writer (DList Char))
-- | Simplified tracedRenderOptionsM when using
-- RenderOptionsM.
tracedRenderOptions :: (label -> String) -> RenderOptions String label
-- | Simplified tracedRenderOptionsAsciiM when using
-- RenderOptionsM.
tracedRenderOptionsAscii :: (label -> String) -> RenderOptions String label
instance GHC.Classes.Ord Data.Tree.Render.Text.BranchPath
instance GHC.Classes.Eq Data.Tree.Render.Text.BranchPath
instance GHC.Show.Show Data.Tree.Render.Text.BranchPath
instance GHC.Classes.Ord Data.Tree.Render.Text.ChildOrder
instance GHC.Classes.Eq Data.Tree.Render.Text.ChildOrder
instance GHC.Show.Show Data.Tree.Render.Text.ChildOrder
instance GHC.Classes.Ord Data.Tree.Render.Text.ParentLocation
instance GHC.Classes.Eq Data.Tree.Render.Text.ParentLocation
instance GHC.Show.Show Data.Tree.Render.Text.ParentLocation