Hey all,
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 aDecoder
, aType
and 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 C
and D
constructors.
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 C
and D
are not part of A
.
Any idea how I can make this work?