Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Oct 10, 2024
1 parent 0cdaae2 commit 5ad14ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/DebuggerSigs.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
type action =
| Emit of Loctext.t
| Trace of [`Open | `Close] * Loctext.t

module type S =
sig
val act : action -> unit
val emit : ?loc:Range.t -> string -> unit
val emitf : ?loc:Range.t -> ('a, Format.formatter, unit, unit) format4 -> 'a
val trace : ?loc:Range.t -> string -> (unit -> 'a) -> 'a
Expand Down
3 changes: 2 additions & 1 deletion src/Reporter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ struct
exnc = (function Fatal d -> fatal d | exn -> raise exn);
effc = fun (type a) (eff : a Effect.t) ->
match eff with
|
| Emit d -> Option.some @@ fun (k : (a, _) Effect.Deep.continuation) ->
Algaeff.Fun.Deep.finally k @@ fun () -> emit d
| _ -> None }

(* Algebraic effects *)

let run ?init_loc ?(init_backtrace=Emp) ~emit ~fatal f =
let run ?init_loc ?(init_backtrace=Emp) ?debug ~emit ~fatal f =
Traces.run ~env:(init_loc, init_backtrace) @@ fun () ->
Effect.Deep.match_with f () @@ handler ~emit ~fatal

Expand Down

0 comments on commit 5ad14ed

Please sign in to comment.