bricks-rendering-0.0.0.4: ...

Safe HaskellSafe
LanguageHaskell2010

Bricks.Rendering

Contents

Synopsis

Render

type Render a = RenderContext -> a -> Text Source #

Expressions

render'expression :: Render Expression Source #

Render an expression.

Examples

>>> :{
>>> render'expression renderContext'terse
>>> (lambda
>>> (param "a" <> pattern
>>> [ dict'param "f"
>>> , dict'param "b" & def (apply (var "g") (var "x"))
>>> ] <> ellipsis)
>>> (apply (var "f") (var "b")))
>>> :}
"a@{ f, b ? g x, ... }: f b"

render'expression'listContext :: Render Expression Source #

Render an expression in a list context.

render'expression'dotLeftContext :: Render Expression Source #

Render an expression in the context of the left-hand side of a Dot.

render'expression'applyLeftContext :: Render Expression Source #

Render an expression in the context of the left-hand side of an Apply.

render'expression'applyRightContext :: Render Expression Source #

Render an expression in the context of the right-hand side of an Apply.

Variables

render'var :: Render Var Source #

Render an unquoted string in unquoted form.

Strings

str'escape :: Text -> Text Source #

Insert escape sequences for rendering normal double-quoted (") strings.

Static strings

render'strStatic'unquotedIfPossible :: Render Str'Static Source #

Render a static string, in unquoted form if possible.

render'strStatic'quoted :: Render Str'Static Source #

Render a static string, in quoted form.

Dynamic strings

render'strDynamic'unquotedIfPossible :: Render Str'Dynamic Source #

Render a dynamic string, in unquoted form if possible.

render'strDynamic'quoted :: Render Str'Dynamic Source #

Render a dynamic string, in quoted form.

Indented strings

Lists

render'list :: Render List Source #

Render a list literal ([ ... ]).

Dicts

render'dict :: Render Dict Source #

Render a dict literal ({ ... }).

render'dictBinding :: Render DictBinding Source #

Render a binding within a Dict, including the trailing semicolon.

Dict lookup

render'dot :: Render Dot Source #

Render a dot expression (a.b).

Lambdas

render'lambda :: Render Lambda Source #

Render a lambda expression (x: y).

Function parameters

render'param :: Render Param Source #

Render a lambda parameter: everything from the beginning of a lambda, up to but not including the : that separates the head from the body of the lambda.

render'dictPattern :: Render DictPattern Source #

Render a dict pattern ({ a, b ? c, ... }).

Function application

render'apply :: Render Apply Source #

Render a function application expression (f x).

let

render'let :: Render Let Source #

Render a let-in expression.

render'letBinding :: Render LetBinding Source #

Render a binding within a Let, including the trailing semicolon.