-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Print Data instances as a nested tree -- -- Provides functionality similar to that of the Show class: -- Taking some arbitrary value and returning a String. -- -- @package data-tree-print @version 0.1.0.2 module DataTreePrint -- | The "simple" printer does not try to fit more than one node into the -- same line, even if it would fit. simplePrintTree :: Data a => a -> Doc -- | Allows to specialize the transformation for specific types. Use -- syb's extQ function(s). See the source of -- defaultLayouterF for an example of how to do this. simplePrintTreeWithCustom :: Data a => ToDocF -> a -> Doc -- | Somewhat more intelligent printer that tries to fit multiple nodes -- into the same line there is space given the specified number of total -- columns. For example, `(1,2,3)` will be printed as "(,,) (1) (2) (3)" -- instead of "(,,)n 1n 2n 3". Parentheses are added in these cases to -- prevent syntactic ambiguities. printTree :: forall a. Data a => Int -> a -> Doc printTreeWithCustom :: Data a => Int -> LayouterF -> a -> Doc showTree :: Data a => a -> String showTreeWithCustom :: Data a => LayouterF -> a -> String -- | This newtype is necessary so fix can be used in combination -- with the constrained forall-quantification. newtype DataToLayouter DataToLayouter :: (forall a. Data a => a -> NodeLayouter) -> DataToLayouter [runDataToLayouter] :: DataToLayouter -> forall a. Data a => a -> NodeLayouter type LayouterF = DataToLayouter -> DataToLayouter data NodeLayouter NodeLayouter :: Int -> Bool -> (Either Bool Int -> Doc) -> NodeLayouter -- | the length of this node, if printed on a single line [_lay_llength] :: NodeLayouter -> Int [_lay_needsParens] :: NodeLayouter -> Bool -- | Left: one-line output, the boolean indicates if parentheses are -- advisable given the context. (They can be omitted in cases like when -- there is only one constructor). Right: The Int is the remaining -- vertical space left for this node. [_lay_func] :: NodeLayouter -> Either Bool Int -> Doc defaultLayouterF :: LayouterF