Skip to content

m-bock/purescript-fmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purescript-fmt

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

About

Format strings, safely.

Resources

Stars

Watchers

Forks

Packages

No packages published