Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- simplePrintTree :: Data a => a -> Doc
- simplePrintTreeWithCustom :: Data a => ToDocF -> a -> Doc
- 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
- newtype DataToLayouter = DataToLayouter {
- runDataToLayouter :: forall a. Data a => a -> NodeLayouter
- type LayouterF = DataToLayouter -> DataToLayouter
- data NodeLayouter = NodeLayouter {
- _lay_llength :: Int
- _lay_needsParens :: Bool
- _lay_func :: Either Bool Int -> Doc
- defaultLayouterF :: LayouterF
Documentation
simplePrintTree :: Data a => a -> Doc Source #
The "simple" printer does not try to fit more than one node into the same line, even if it would fit.
simplePrintTreeWithCustom :: Data a => ToDocF -> a -> Doc Source #
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.
printTree :: forall a. Data a => Int -> a -> Doc Source #
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.
newtype DataToLayouter Source #
This newtype is necessary so fix
can be used in combination with
the constrained forall-quantification.
DataToLayouter | |
|
type LayouterF = DataToLayouter -> DataToLayouter Source #
data NodeLayouter Source #
NodeLayouter | |
|