aboutsummaryrefslogtreecommitdiffhomepage
path: root/engine
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2015-10-19 18:18:34 +0200
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2015-10-19 18:18:34 +0200
commitc7dcb76ffff6b12b031e906b002b4d76c1aaea50 (patch)
tree8d5115258c3b7042767e45d742e2800dab209822 /engine
parent666568377cbe1c18ce479d32f6359aa61af6d553 (diff)
parent50a574f8b3e7f29550d7abf600d92eb43e7f8ef6 (diff)
Merge branch 'v8.5'
Diffstat (limited to 'engine')
-rw-r--r--engine/logic_monad.ml17
-rw-r--r--engine/logic_monad.mli9
2 files changed, 13 insertions, 13 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
diff --git a/engine/logic_monad.mli b/engine/logic_monad.mli
index 35dd311a8..42a84f830 100644
--- a/engine/logic_monad.mli
+++ b/engine/logic_monad.mli
@@ -55,12 +55,13 @@ module NonLogical : sig
val read_line : string t
val print_char : char -> unit t
- (** {!Pp.pp}. The buffer is also flushed. *)
- val print : Pp.std_ppcmds -> unit t
- (* FIXME: shouldn't we have a logger instead? *)
- (** {!Pp.pp}. The buffer is also flushed. *)
+ (** Loggers. The buffer is also flushed. *)
val print_debug : Pp.std_ppcmds -> unit t
+ val print_warning : Pp.std_ppcmds -> unit t
+ val print_notice : Pp.std_ppcmds -> unit t
+ val print_info : Pp.std_ppcmds -> unit t
+ val print_error : Pp.std_ppcmds -> unit t
(** [Pervasives.raise]. Except that exceptions are wrapped with
{!Exception}. *)