On 4 February 2015 at 17:51, Leo White <[email protected]> wrote:
> It seems to me that:
>
>   exception Error : 'a * (formatter -> 'a -> unit) -> exn
>
> should do the trick, allowing you to wrap up the error and its printer
> as an exception. (Note using existential variables directly in exceptions
> like this requires 4.02, for earlier versions you must nest a GADT within
> the exception).

There's a simpler solution than either an existential or a nested GADT
here: simply eliminate the type variable altogether:

    exception Error of (formatter -> unit)

A function of this type is just as convenient to use with
Format.printf etc., since you can use '%t' instead of '%a'.

_______________________________________________
MirageOS-devel mailing list
[email protected]
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

Reply via email to