0 | module Text.PrettyPrint.Prettyprinter.Util
3 | import Text.PrettyPrint.Prettyprinter.Doc
4 | import Text.PrettyPrint.Prettyprinter.Render.String
10 | words : String -> List (Doc ann)
11 | words s = map pretty $
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'')
23 | reflow : String -> Doc ann
24 | reflow = fillSep . words
28 | putDocW : Nat -> Doc ann -> IO ()
29 | putDocW w = renderIO . layoutPretty ({ layoutPageWidth := AvailablePerLine (cast w) 1 } defaultLayoutOptions)