Format strings, safely.
spago install fmt
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.
- Compile-time format string validation
- Easily extensible with custom formatter type class
- Configurable placeholder syntax
- Zero runtime overhead if used with purs-backend-es