bricks-0.0.0.2: Bricks is a lazy functional language based on Nix.

Safe HaskellSafe
LanguageHaskell2010

Bricks.UnquotedString

Contents

Synopsis

Type

newtype Str'Unquoted Source #

A string that can be rendered unquoted. Unquoted strings are restricted to a conservative set of characters; see str'canRenderUnquoted for the full rules.

The constructor is tagged "unsafe" because it lets you construct and invalid value. Prefer str'tryUnquoted which does validate the text.

Constructor

str'unquoted'orThrow :: Text -> Str'Unquoted Source #

Throws an exception if the string cannot render unquoted.

Predicates

str'canRenderUnquoted :: Text -> Bool Source #

Whether a string having this name can be rendered without quoting it. We allow a string to render unquoted if all these conditions are met:

>>> str'canRenderUnquoted "-ab_c"
True
>>> str'canRenderUnquoted ""
False
>>> str'canRenderUnquoted "a\"b"
False
>>> str'canRenderUnquoted "let"
False

char'canRenderUnquoted :: Char -> Bool Source #

Letters, -, and _.