0 | module Libraries.Text.PrettyPrint.Prettyprinter.Util
3 | import Libraries.Text.PrettyPrint.Prettyprinter.Doc
4 | import Libraries.Text.PrettyPrint.Prettyprinter.Render.String
10 | words : String -> List (Doc ann)
11 | words s = map pretty0 $
map pack (helper (unpack s))
13 | helper : List Char -> List (List Char)
15 | case dropWhile isSpace s of
17 | s' => let (w, s'') = break isSpace s' in
18 | w :: helper (assert_smaller s s'')
22 | annotateM : Maybe ann -> Doc ann -> Doc ann
23 | annotateM = maybe id annotate
28 | reflow : String -> Doc ann
29 | reflow = fillSep . words
33 | putDocW : Nat -> Doc ann -> IO ()
34 | putDocW w = renderIO . layoutPretty ({ layoutPageWidth := AvailablePerLine (cast w) 1 } defaultLayoutOptions)