text-format-heavy-0.1.4.0: Full-weight string formatting library, analog of Python's string.format

Safe HaskellNone
LanguageHaskell2010

Data.Text.Format.Heavy.Parse.Braces

Contents

Description

This module defines the default syntax of format strings, generally described as "any part in braces is variable substitution".

Examples of valid variable substitutions are:

  • "Simple: {}"
  • "Numbered: {0}"
  • "Named: {var}"
  • "Specifying variable formatting: {var:+8.4}"

Synopsis

Parse functions

parseFormat :: Text -> Either ParseError Format Source #

Parse string format definition.

parseFormat' :: Text -> Format Source #

Version of parseFormat which throws error in case of syntax error in the formatting string.

Parsec functions

pBracesFormat :: Parser Format Source #

Parsec parser for string format.