require-0.4.11: Scrap your qualified import clutter
Safe HaskellNone
LanguageHaskell2010

Require.Transform

Synopsis

Documentation

type TransformM = StateT TransformState (WriterT (DList Text) (Either Error)) Source #

The monad stack used during transformation:

  • StateT TransformState to keep track of whether to render the next line tag, the module's name etc.
  • WriterT (DList Text) to collect the output lines. Instead of haskell's built-in list type we use DList because of it's O(1) append operation.
  • Either Error to return errors.

output :: Text -> TransformM () Source #

Outputs a single line.

renderLineTag :: LineTag -> TransformM () Source #

Outputs the pragma representation of the given line tag.

ignoreLineTag :: LineTag -> TransformM () Source #

Ignore the given line tag, specifically don't render it.