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

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


  • To: Richard Mortier <richard.mortier@xxxxxxxxxxxx>
  • From: Anil Madhavapeddy <anil@xxxxxxxxxx>
  • Date: Tue, 18 Oct 2016 15:06:57 +0100
  • Cc: "mirageos-devel@xxxxxxxxxxxxxxxxxxxx" <mirageos-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 18 Oct 2016 14:07:07 +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=nsSvijzdj0COwicmTiesYfoScTdO5Nd/ng4q3WJ4Rt8lLK724A9 LttOfL5V4tunYT7L0vORBt8ufXoSZVaM6v0O6Tn2/zcFw6m3/1OQZ9g3UZDzDCjD ZyAPIFv/uQdo6z3E0aLzET5pQNdvNNvAcxxrU0VTuOw6hdv0Q7ArJTt0=
  • List-id: Developer list for MirageOS <mirageos-devel.lists.xenproject.org>

On 18 Oct 2016, at 15:01, Richard Mortier <richard.mortier@xxxxxxxxxxxx> wrote:
> 
> On 18 October 2016 at 15:00, Daniel Bünzli <daniel.buenzli@xxxxxxxxxxxx> 
> wrote:
>> On Tuesday 18 October 2016 at 15:41, Richard Mortier wrote:
>>> Sorry-- not familiar enough with the terminology. Any chance one of
>>> you could point to an example of using "inclusion rather than union"
>>> please?
>> 
>> type err = [ `Sub of Sub.err | `Other | ... ]
>> 
>> vs
>> 
>> type err = [ Sub.err | `Other | ... ]
> 
> Ah! Thanks :)

Another example in Cohttp are the HTTP error codes, which are classified
in various polymorphic variant structures:

https://github.com/mirage/ocaml-cohttp/blob/master/lib/code.mli#L23
... to ...
https://github.com/mirage/ocaml-cohttp/blob/master/lib/code.mli#L112

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