Package

purescript-fmt

Repository
thought2/purescript-fmt
License
BSD-3-Clause
Uploaded by
pacchettibotti
Published on
2023-09-17T21:01:48Z

Format strings, safely.

fmt

Installation

spago install fmt

Sample

module Demo where

import Fmt (fmt)

greeting :: String
greeting =
  fmt
    @"""
      Hello, my name is {name}.
      I live in {city}.
      I am {age} years old.
    """
    { name: "Tom"
    , city: "London"
    , age: 42
    }

You can check out more examples here.

There's also a guide about runtime perfomance.

Features

  • Compile-time format string validation
  • Easily extensible with custom formatter type class
  • Configurable placeholder syntax
  • Zero runtime overhead if used with purs-backend-es
Modules
Fmt
Fmt.Config
Dependencies