mirage / ezjsonm

An easy interface on top of the Jsonm library.
Other
40 stars 22 forks source link

Design of accessors functions #44

Open lindig opened 3 years ago

lindig commented 3 years ago

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.