`string text ${$.event.name} string text`
where
context= [ ("$", { "event": { "name": "foobar" } })]
We limited Template Literals in this way to simplify the implementation for our initial release.
It would be nice to be able to perform arbitrary operations inside template expressions, eg:
`Fifteen is ${a + b}`
Since Kriti maps Value -> Value we would need to cast all values to Value.String. We can use Data.Aeson.encode to serialize the Aeson values and then concat them into our string.
In the case of Map and List values, do we want to simply serialize the data structure or should we throw a runtime error?
Kriti's Template Literal format is:
Expressions are limited to path lookups, eg;
We limited Template Literals in this way to simplify the implementation for our initial release.
It would be nice to be able to perform arbitrary operations inside template expressions, eg:
Since Kriti maps
Value -> Value
we would need to cast all values toValue.String
. We can useData.Aeson.encode
to serialize the Aeson values and then concat them into our string.In the case of Map and List values, do we want to simply serialize the data structure or should we throw a runtime error?