Skip to content

purescripters/purescript-template-strings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purescript-template-strings

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"