Source

screentime-monitor / rule.mli

Full commit
open Core.Std

module Name : Identifiable

type t =
  { name       : Name.t
  ; days       : Day_of_week.t list
  ; categories : Category.t Blang.t
  ; limit      : Time.Span.t
  }
with sexp, bin_io, fields
include Comparable.S_binable with type t := t
include Stringable with type t := t

(** Returns the list of violations of the rule, where the time spans are the
    amount by which each scope is over the limit. *)
val check
  :  t
  -> (Date.t * Daylog.Closed.t) list
  -> [ `Ok | `Exceeded of Time.Span.t ]


module List : sig
  type nonrec t = t list with sexp, bin_io
end