The accessor functions raise exceptions when their preconditions are not met. What is your take on an additional interface, maybe in a submodule Opt or similar, which returns option values instead? I believe this would facilitate using Option.bind quite nicely and monadic error handling. Given the dynamic nature of JSON values, error handling somewhat cumbersome and this could help to make it smoother.
The accessor functions raise exceptions when their preconditions are not met. What is your take on an additional interface, maybe in a submodule
Opt
or similar, which returnsoption
values instead? I believe this would facilitate usingOption.bind
quite nicely and monadic error handling. Given the dynamic nature of JSON values, error handling somewhat cumbersome and this could help to make it smoother.