We have quite a few base libraries that use the pattern of

val foo_exn : ... -> 'a

val foo: ... -> 'a option
Gobbles the exception and returns Some/None

Should we take the Mirage3 opportunity to port libraries like Ipaddr to using 
the Result type instead, so it would be

val foo : ... -> ('a, [`Msg of string]) result

instead, using the Result type?  That would let libraries use combinators such 
as Rresult, and not gobble errors from parsing silently.  It would be an 
incompatible API bump so we would need to bump all consumers of, e.g. Ipaddr  
http://docs.mirage.io/ipaddr/Ipaddr_unix.V4.html simultaneously.


MirageOS-devel mailing list

Reply via email to