dhall-golang icon indicating copy to clipboard operation
dhall-golang copied to clipboard

How to decode an enum

Open sporto opened this issue 4 years ago • 0 comments

Hi, originally asked here but no responses so far https://discourse.dhall-lang.org/t/decode-enum-using-go/492 Could you give me an example of how to decode an enum into a Go type?

Dhall:

let Day =
      < Monday | Tuesday | ... >

Go:

type Thing struct {
   Name string `dhall:"name"`
   Day ????? `dhall:"day"`  <-- what goes here?
}

Thanks

sporto avatar Jul 05 '21 22:07 sporto