Closed clarus closed 2 years ago
I guess we could. In all cases, I'd rather not do it at the C level. It's easy to add such functions as OCaml wrappers, but then it could be done on the client side as well, no need to clutter the library. Which exceptions are raised by which functions is well documented, so I don't get why it can be hard to track sometimes, and where the need comes from. The API is much closer to Int64
(which has very few option types) than List
, so the comparison is not very apt.
OK, yes it can be done client-side. Closing then. To me, the main interest would be to encourage people to write exception-free code with explicit error handling, when this is needed.
Hello,
Many of the ZArith primitives can raise an exception (division per zero, overflow when converting to
int
, ...) and this can be hard to track sometimes. I think it would be cool to have_opt
versions returning an option type instead, as for the standard library of OCaml withList.find
andList.find_opt
for example. I can contribute if needed.Thanks!