fmt-0.6.3.0: A new formatting library
Safe HaskellNone
LanguageHaskell2010

Fmt.Internal.Core

Synopsis

Documentation

class FromBuilder a where Source #

Methods

fromBuilder :: Builder -> a Source #

Convert a Builder to something else.

Instances

Instances details
FromBuilder ByteString Source # 
Instance details

Defined in Fmt.Internal.Core

FromBuilder ByteString Source # 
Instance details

Defined in Fmt.Internal.Core

FromBuilder Builder Source # 
Instance details

Defined in Fmt.Internal.Core

FromBuilder Text Source # 
Instance details

Defined in Fmt.Internal.Core

FromBuilder Text Source # 
Instance details

Defined in Fmt.Internal.Core

FromBuilder Builder Source # 
Instance details

Defined in Fmt.Internal.Core

a ~ Char => FromBuilder [a] Source # 
Instance details

Defined in Fmt.Internal.Core

Methods

fromBuilder :: Builder -> [a] Source #

a ~ () => FromBuilder (IO a) Source # 
Instance details

Defined in Fmt.Internal.Core

Methods

fromBuilder :: Builder -> IO a Source #

(+|) :: FromBuilder b => Builder -> Builder -> b infixr 1 Source #

Concatenate, then convert.

(|+) :: (Buildable a, FromBuilder b) => a -> Builder -> b infixr 1 Source #

build and concatenate, then convert.

(+||) :: FromBuilder b => Builder -> Builder -> b infixr 1 Source #

Concatenate, then convert.

(||+) :: (Show a, FromBuilder b) => a -> Builder -> b infixr 1 Source #

show and concatenate, then convert.

(|++|) :: (Buildable a, FromBuilder b) => a -> Builder -> b infixr 1 Source #

(||++||) :: (Show a, FromBuilder b) => a -> Builder -> b infixr 1 Source #

(|++||) :: (Buildable a, FromBuilder b) => a -> Builder -> b infixr 1 Source #

(||++|) :: (Show a, FromBuilder b) => a -> Builder -> b infixr 1 Source #

fmt :: FromBuilder b => Builder -> b Source #

fmt converts things to String, Text, ByteString or Builder.

Most of the time you won't need it, as strings produced with (+|) and (|+) can already be used as String, Text, etc. However, combinators like listF can only produce Builder (for better type inference), and you need to use fmt on them.

Also, fmt can do printing:

>>> fmt "Hello world!\n"
Hello world!

fmtLn :: FromBuilder b => Builder -> b Source #

Like fmt, but appends a newline.

pretty :: (Buildable a, FromBuilder b) => a -> b Source #

pretty shows a value using its Buildable instance.

prettyLn :: (Buildable a, FromBuilder b) => a -> b Source #

Like pretty, but appends a newline.