morley-prelude-0.6.0: A custom prelude used in Morley
Safe HaskellSafe-Inferred
LanguageHaskell2010

Fmt.Utils

Description

Compatibility layer between prettyprinter and wl-pprint-text

Synopsis

Documentation

type Doc = Doc () Source #

Document without annotations

type SimpleDoc = SimpleDocStream () Source #

Simple document without annotations

isEmpty :: Doc -> Bool Source #

Check if Doc is mempty. Note that empty strings are also considered empty.

>>> isEmpty mempty
True
>>> isEmpty ""
True
>>> isEmpty "foo"
False

linebreak :: Doc Source #

Rendered as newline, when undone by group, is mempty.

softbreak :: Doc Source #

Like mempty if the output fits the page, otherwise like line.