Example or docs for unmarshalling into a Go interface (or workarounds for the same)
I'm trying to unmarshal a type into a Go interface (type Arg interface { visitArg(argVisitor) error }); however, dhall-golang (understandably) doesn't know how to decode Dhall types into the Go interface. I was expecting something like the json.Unmarshaler interface that I could use to help dhall-golang figure out how to unmarshal to the proper type; however, I'm not seeing that sort of interface in the godoc pages or elsewhere. If someone could point me in the right direction, it would be appreciated. Also, it would probably be good to mention the solution in the docs somewhere.
Thanks for the report! Can you give an example of what it looks like in json, and how you think it might work in dhall? I'm not sure I fully understand.
Worth saying: I think there is a missing feature here but I want to solicit feedback about what problems people have and what solutions might work.
Yeah, sure. Here's a contrived example of how I would solve the problem in JSON: https://play.golang.org/p/DdHaLSDF_iw
I'm happy to answer questions if that's unclear.
Would something like https://github.com/philandstuff/dhall-golang/pull/51/files#diff-6dc6f145fee99532de7783d273cc747f be a suitable solution for you?