forked from TristanCacqueray/python-dhall
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
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:
- success if
./configdefines a record withfooandbar - failure if
./configdoesn't exist or isn't valid Dhall - failure if
./configdefines 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?
Metadata
Metadata
Assignees
Labels
No labels