Open koterpillar opened 2 years ago
In Haskell bindings, I can use some typeclasses to load a Dhall value of an expected type (official example). I would like to do the same in Python:
@dataclass class Example: foo: int bar: list[double] x = dhall.load(open('./config'), type_=Example)
The intended result:
./config
foo
bar
How do I do this with dhall-python? If it's not currently possible, any pointers on implementation?
In Haskell bindings, I can use some typeclasses to load a Dhall value of an expected type (official example). I would like to do the same in Python:
The intended result:
./config
defines a record withfoo
andbar
./config
doesn't exist or isn't valid Dhall./config
defines any other Dhall value (number, boolean, different fields, etc.)How do I do this with dhall-python? If it's not currently possible, any pointers on implementation?