Module

Data.TemplateString.Unsafe

Package
purescript-template-strings
Repository
purescripters/purescript-template-strings

#templateBy Source

templateBy :: forall a. (String -> String) -> String -> Record a -> String

Unsafe: JavaScript will coerce values to strings. Supports a key mapping function for transforming keys found in the template.

Example:

> templateBy String.toUpper "${foo} ${Foo} ${FOO}" { FOO: 42 }
= "42 42 42"

#template Source

template :: forall a. String -> Record a -> String

Unsafe: JavaScript will coerce values to strings. Keys must match exactly.

Example:

> "${foo} ${Foo} ${FOO} ${Bar}" <~> { Foo: 42, Bar: "!!!" }
= "${foo} 42 ${FOO} !!!"

#(<~>) Source

Operator alias for Data.TemplateString.Unsafe.template (non-associative / precedence 7)