Package

purescript-template-strings

Repository
purescripters/purescript-template-strings
License
MIT
Uploaded by
LiamGoodacre
Published on
2019-08-19T08:43:42Z

Latest release

Sample usage:

> import Data.TemplateString.Unsafe ((<~>))
> "Hello, ${firstName} ${lastName}!" <~> { firstName: "Haskell", lastName: "Curry" }
"Hello, Haskell Curry!"

> "The answer: ${answer}" <~> { answer: 42 }
"The answer: 42"
> import Data.TemplateString ((<^>))
> import Data.Tuple.Nested ((/\))
> import Data.Show (show)
> "Pi: ${pi}, Phi: ${phi}" <^> ["pi" /\ (show 3.1415), "phi" /\ (show 1.618)]
"Pi: 3.1415, Phi: 1.618"
> import Data.TemplateString ((<->))
> import Data.Tuple.Nested ((/\))
> "Pi: ${pi}, Phi: ${phi}" <-> ["pi" /\ 3.1415, "phi" /\ 1.618]
"Pi: 3.1415, Phi: 1.618"