|
First working mockup of a dhall Haskell API that can read files of
the (normalized) form
```
\(CustomType: Type) ->
\(AnotherType: Type) ->
…
```
and set their actual representation on the Haskell side.
This has various advantages:
- dhall files still type check & normalize with the normal dhall
tooling, they are standalone (and the types can be instantiated from
dhall as well without any workarounds)
- It can be used like the default `input` function, no injection of
custom symbols in the Normalizer is reqired
- Brings this style of dhall integration to Haskell, where it was only
feasible in nix before, because that is untyped
The dhall types can be instantiated by every Haskell type that has an
`Interpret` instance. The “name” of the type lambda variable is
compared on the Haskell side with a type-level string that the user
provides, to prevent mixups.
TODO:
- Improve error messages (!)
- Provide a way to re-use the type mapping on the Haskell side, so
that the returned values are not just the normal `Interpret` types,
but the mapped ones (with name phantom type)
|