package incremental

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file at.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
open Core
open! Import
open Types.Kind
module Node = Types.Node

type t = Types.At.t =
  { main : Before_or_after.t Node.t
  ; at : Time_ns.t
  ; mutable alarm : Alarm.t
  ; clock : (Types.Clock.t[@sexp.opaque])
  }
[@@deriving fields ~iterators:iter, sexp_of]

let invariant t =
  Invariant.invariant [%here] t [%sexp_of: t] (fun () ->
    let check f = Invariant.check_field t f in
    Fields.iter
      ~main:
        (check (fun (main : Before_or_after.t Node.t) ->
           match main.kind with
           | Invalid -> ()
           | Const After -> () (* happens once the current time passes [t.at]. *)
           | At t' -> assert (phys_equal t t')
           | _ -> assert false))
      ~at:ignore
      ~alarm:(check Alarm.invariant)
      ~clock:ignore)
;;
OCaml

Innovation. Community. Security.