[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [MirageOS-devel] Irmin roadmap
>> Please feel free to comment if you find something which is not clear or >> which could be improved. > Very quick look. The semantics of timestamps is unspecified: > > http://samoht.github.io/irmin/Irmin.Task.html#VALdate > > Also the uniqueness scope of task uids should be precised. I think I've addressed these in the freshly updated documentation. > Besides I see you are using universal values. I don't know if that's useful > but you may want to enrich the type a little bit so that you are able to > print some diagnostics about them without knowing the client keys. The idea > is that client should give a to_string function when they create the key, you > can then simply hack a to_string function on universal types using this. > There may be more elegant ways but here is one solution (also I would have > suggested Formatter, but you may not want to introduce that dependency, see > also the types of Task.{create,fprintf} ): > > type univ = { u : exn; str : unit -> string } > > let univ_create (type s) to_string = > let module M = struct exception E of s end in > (fun v -> { u = M.E v; str = (fun () -> to_string v) }), > (function { u = M.E v } -> Some v | _ -> None) > > let to_string u = u.str () > > Of course the same idea can be applied to other processors you may want on > universal values (e.g. marshal). I've tried to apply that using mirage-tc and I now have: val create : 'a Tc.t -> ('a -> t) * (t -> 'a option) * t Tc.t where a value of type 'a Tc.t can be passed to Tc.show, Tc.of_json, Tc.to_json, etc... Not sure how well it works in practice (I managed to get the top-level throws an interesting exception while evaluation Ir_univ.ml with few examples), I'll see soon in the backend code. Thanks, Thomas _______________________________________________ MirageOS-devel mailing list MirageOS-devel@xxxxxxxxxxxxxxxxxxxx http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |