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

Re: [MirageOS-devel] Module inclusion error in 4.01



>> Dave and I are seeing a new error with 4.01.0 with this standalone MLI file 
>> in mirage-types (it works with 4.00.1):
>> 
>> https://raw.github.com/djs55/mirage-types/2634b03bcf99f0aba9696ede5a60bf8b67f0db30/lib/v1.mli
>> 
>> File "lib/v1.mli", line 250, characters 4-23:
>> Error: This variant or record definition does not match that of type error
>>       Their kinds differ.
>> Command exited with code 2.
> 
> The simplest fix is to simply leave the error type abstract until the
> leaf module types.  

I've implemented that solution there:

https://github.com/samoht/mirage-types/commit/98bf70a92cbbab5ba38d80f45f344a32c474864c

--
Thomas

> There's a slightly neater approach in this case,
> though: make the error type in KV_RO a private row, and extend it in
> FS.  The definition of error in KV_RO would then be
> 
>  type error =
>    private [> `Unknown_key of string ]
> 
> and the definition of error in FS would become
> 
>  type error = [
>    | `Not_a_directory of string
>    (* ... *)
>    | `Block_device of block_device_error
>    | `Unknown_key of string
>  ]
> 
> (The minor downside is that callers of KV_RO.read would need to handle
> both `Error (`Unknown_key s) and some unspecified/unknowable set of
> tags.)
> 
> Jeremy.
> 
> _______________________________________________
> MirageOS-devel mailing list
> MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://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®.