package nloge

  1. Overview
  2. Docs

Source file time.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
type _ Effect.t += Get : Eio.Time.clock Effect.t

let get () = Effect.perform Get
let now' () = Eio.Time.now @@ get ()

let run (clock : #Eio.Time.clock) f =
  let open Effect.Deep in
  let effc : type a. a Effect.t -> ((a, 'r) continuation -> 'r) option = function
    | Get -> Some (fun k -> continue k clock)
    | _ -> None
  in
  try_with f () { effc }
;;
OCaml

Innovation. Community. Security.