diff options
author | Profpatsch <mail@profpatsch.de> | 2019-05-18 16:10:50 +0200 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2019-05-18 16:10:50 +0200 |
commit | 26f284751ec07f15fedd5d8e84c8f7203732d7b3 (patch) | |
tree | 2521794bf3eb0a67380bda14b460771e73f2ab2a /lib | |
parent | b3f5a88eba6f1cc0952b47f89e3f13a74d1aecd8 (diff) |
pkgs/profpatsch: Haskell dhall import with custom types
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)
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions