Safe Haskell | None |
---|---|
Language | Haskell2010 |
Agda.Utils.DocTree
Description
A simple document tree to render
but preserve annotations.Doc
ann
DocTree
and renderToTree'
originally taken from
https://github.com/plt-amy/agda/blob/9fd50b883f14a05792ed79a0b693fbecb2165bf5/src/full/Agda/LSP/Output.hs
but rewritten to encode more invariants.
Synopsis
- data DocTree ann
- prettyDocTree :: DocTree ann -> Doc ann
- renderToTree :: Null ann => Doc ann -> DocTree ann
- renderToTree' :: Null ann => Width -> Fill -> Doc ann -> DocTree ann
- renderTree' :: forall ann t. Monoid t => (Text -> t) -> (ann -> t -> t) -> DocTree ann -> t
- treeToText :: (ann -> Text -> Text) -> DocTree ann -> Text
- treeToTextNoAnn :: DocTree ann -> Text
- treeToTextWithAnn :: (Monoid ann, Null ann) => DocTree ann -> (Text, RangeMap ann)
Documentation
A rendered document with annotations from type ann
.
Instances
prettyDocTree :: DocTree ann -> Doc ann Source #
renderTree' :: forall ann t. Monoid t => (Text -> t) -> (ann -> t -> t) -> DocTree ann -> t Source #
Generic DocTree
linearization.
treeToTextNoAnn :: DocTree ann -> Text Source #