diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2015-10-19 18:18:34 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2015-10-19 18:18:34 +0200 |
commit | c7dcb76ffff6b12b031e906b002b4d76c1aaea50 (patch) | |
tree | 8d5115258c3b7042767e45d742e2800dab209822 /engine/logic_monad.ml | |
parent | 666568377cbe1c18ce479d32f6359aa61af6d553 (diff) | |
parent | 50a574f8b3e7f29550d7abf600d92eb43e7f8ef6 (diff) |
Merge branch 'v8.5'
Diffstat (limited to 'engine/logic_monad.ml')
-rw-r--r-- | engine/logic_monad.ml | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/engine/logic_monad.ml b/engine/logic_monad.ml index 47a5510b0..75134e6f1 100644 --- a/engine/logic_monad.ml +++ b/engine/logic_monad.ml @@ -94,14 +94,6 @@ struct let print_char = fun c -> (); fun () -> print_char c - (** {!Pp.pp}. The buffer is also flushed. *) - let print_debug = fun s -> (); fun () -> try Pp.msg_info s; Pp.pp_flush () with e -> - let (e, info) = Errors.push e in raise ~info e () - - (** {!Pp.pp}. The buffer is also flushed. *) - let print = fun s -> (); fun () -> try Pp.msg_notice s; Pp.pp_flush () with e -> - let (e, info) = Errors.push e in raise ~info e () - let timeout = fun n t -> (); fun () -> Control.timeout n t (Exception Timeout) @@ -111,6 +103,13 @@ struct let (e, info) = Errors.push e in Util.iraise (Exception e, info) + (** Use the current logger. The buffer is also flushed. *) + let print_debug s = make (fun _ -> Pp.msg_info s;Pp.pp_flush ()) + let print_info s = make (fun _ -> Pp.msg_info s;Pp.pp_flush ()) + let print_warning s = make (fun _ -> Pp.msg_warning s;Pp.pp_flush ()) + let print_error s = make (fun _ -> Pp.msg_error s;Pp.pp_flush ()) + let print_notice s = make (fun _ -> Pp.msg_notice s;Pp.pp_flush ()) + let run = fun x -> try x () with Exception e as src -> let (src, info) = Errors.push src in @@ -155,7 +154,7 @@ struct shape of the monadic type is reminiscent of that of the continuation monad transformer. - The paper also contains the rational for the [split] abstraction. + The paper also contains the rationale for the [split] abstraction. An explanation of how to derive such a monad from mathematical principles can be found in "Kan Extensions for Program |