Generic Inject instances and new sum types


(Vanessa McHale) #1

Hi all,

I know the new Dhall standard supports sum types such as

let Arch = < Arm
           | X86
           | Sparc
           >
in
…

My question is: would this work with the generic Interpret/Inject instances generated from the below?

data Arch = Arm
          | X86
          | Sparc
          deriving (Generic, Interpret, Inject)

Or do the generic instances still require something like

let Arch = < Arm : {}
           | X86 : {}
           | Sparc : {}
           >
in
…

?

Thanks!
-Vanessa


(Gabriel Gonzalez) #2

@vmchale: There’s a bug that causes the Generic-derived instance to misbehave, which will be fixed in:

After that is fixed, a Haskell enum should correspond to a Dhall enum (i.e. < Arm | X86 | Sparc >)


(Vanessa McHale) #3

Ah okay! Thanks! I’ll have a look at the upstream.