module Formatting.Examples where
import Data.Text.Lazy (Text)
import Data.Text.Lazy.Builder (Builder)
import Formatting
hello :: Text
hello = format ("Hello, World!")
strings :: Text
strings =
  format ("Here comes a string: " % string % " and another " % string)
         "Hello, World!"
         "Ahoy!"
texts :: Text
texts =
  format ("Here comes a string: " % text % " and another " % text)
         "Hello, World!"
         "Ahoy!"
builders :: Text
builders =
  format ("Here comes a string: " % builder % " and another " % text)
         ("Hello, World!" :: Builder)
         "Ahoy!"
integers :: Text
integers =
  format ("Here comes an integer: " % int % " and another: " % int)
         (23 :: Int)
         (0 :: Integer)
floats :: Text
floats =
  format ("Here comes a float: " % float % " and a double with sci notation: " % prec 6)
         (123.2342 :: Float)
         (13434242423.23420000 :: Double)
hexes :: Text
hexes =
  format ("Here comes a hex: " % hex)
         (123 :: Int)
padding :: Text
padding =
  format ("A left-padded number: " % left 3 '0')
         (9 :: Int)