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

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


  • To: Ashish Agarwal <agarwal1975@xxxxxxxxx>
  • From: Anil Madhavapeddy <anil@xxxxxxxxxx>
  • Date: Tue, 18 Oct 2016 14:33:51 +0100
  • Cc: "mirageos-devel@xxxxxxxxxxxxxxxxxxxx" <mirageos-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 18 Oct 2016 13:33:59 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=recoil.org; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; q=dns; s= selector1; b=GVleMjvYn3lD7GwbSYDBWf4V03QJOcaUeD5Pn4uU9XMzwJQsxGN bJuoZg4DihmKlIQpV7WfjrJIuBTD3n2FfWtPUrxIxfaEjCTy2di5/w7KIICsUvuQ cBBQ/39yau8mVarhoHwsXBL1S51TNIWNsirHC/NlmsBlq2z2itrv1eFA=
  • List-id: Developer list for MirageOS <mirageos-devel.lists.xenproject.org>

On 18 Oct 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.
>  
> 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.

Yeah, the toplevel printing can be dealt with by general improvements to OCaml 
error handling.  We probably shouldn't let the quality of OCaml's existing 
error message printing guide the API design here, but rather work on the 
co-evolution of the language and MirageOS libraries to get any such issues 
fixed in the longer term upstream.

Anil

_______________________________________________
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®.