Added `normalizeWith` function to complement `typeWith`.
Dhall is so very attractive base for simple DSLs that I felt it
needed to be pushed over the edge.
Naturally, using `normalizeWith` loses all the nice features of Dhall.
If your context isn't total or strongly normalizing then embedding it
to Dhall will not improve things.
You can now interpolate any expression of type `Text` into a string literal,
like this:
```haskell
let renderRating
= λ(rating : { name : Text, rating : Natural })
→ let score = Integer/show (Natural/toInteger rating.rating)
in ''
# My thoughts about ${rating.name} (${score} out of 5)
''
in renderRating { name = "Dhall", rating = +6 }
```
The previous tests for `build . fold` fusion for `Optional` values would
succeed even without fusion. This change updates the tests to only
succeed if fusion is occurring.
This change updates the test to test Dhall source code so that we're
exercising the system from end to end. This also makes it easier to
author tests since expressions can be written as Dhall source code
instead of an abstract syntax tree.
- Defines a new primitive `OptionalFold`
- Implements normalization:
- inlining of Optional/build if constants are used as args
- fusion of fold/build and build/fold