[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Using Result instead of Option in libraries



On 18 October 2016 at 14:24, Ashish Agarwal <agarwal1975@xxxxxxxxx> wrote:
> On Tue, Oct 18, 2016 at 4:38 AM, Daniel Bünzli <daniel.buenzli@xxxxxxxxxxxx>
> wrote:
>
>> I think you should transform your errors according to your level of
>> abstraction as much as you do with your values.
>
> That's a good goal.

Yes; I think it fits very well with the point of view I think
previously expressed by one (or both :) of you that the distinction
Ok/Error is rather false-- the problem is actually to be able to treat
subsets of possible return values in aggregate, rather than the tags
`Ok or `Error having any special meaning.

>> Also using inclusion (by tagging an error subset) rather than union for
>> errors reported by subsystems allows you to work with a constant set of
>> variants at a given abstraction level which lessens the problems.
>
> I've tried that, and only problem was I ended up with rather big types.
> Appropriate naming could get around that, at least in the mli's. Crazy types
> might still get printed out by utop, but that doesn't bother me too much.

Sorry-- not familiar enough with the terminology. Any chance one of
you could point to an example of using "inclusion rather than union"
please?

Thanks!

-- 
Richard Mortier
richard.mortier@xxxxxxxxxxxx

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.