I have a Haskell program I’m using to generate some Dhall types. Here’s an example:
data B' = C Text | D Text data A = A Text | B B'
I then have functions like
aText to pretty print the type as a Dhall type. The problem is that it gets printed like:
let A = < A : Text | B : < C Text | D Text > >
Which leaves consumers of this type unable to access the
Next I tried adding a decoder for the
B' type and printing it in the same file. Problem is, this is a completely different type from what the
B constructor accepts. I tried hacking it by manually replacing the
B constructor’s type with the
B' type, and that solved things until it came to bringing the data back into Haskell, at which point I get a type error saying that
D are not part of
Any idea how I can make this work?