module Day_of_week: Day_of_week
type
t
include Hashable.S
include Comparable.S
include Stringable.S
of_string s
accepts three-character abbreviations with any capitalization
val invariant : t -> unit
val sun : t
val mon : t
val tue : t
val wed : t
val thu : t
val fri : t
val sat : t
type
variant = [ `Fri | `Mon | `Sat | `Sun | `Thu | `Tue | `Wed ]
val get : t -> variant
val create : variant -> t
conversion between ints and weekdays uses the same mapping as Unix.tm_wday.
0 <-> Sun, ... 6 <-> Sat
val of_int : int -> t option
of_int i
returns i'th weekday if i
is in 0,1,...,6. Otherwise it returns
None.
val of_int_exn : int -> t
of_int_exn i
should have i in 0,1,...,6 and returns the i'th weekday.
val to_int : t -> int
to_int t
returns an int in 0,1,...6.
val shift : t -> int -> t
shift t i
goes forward (or backward) the specified number of weekdays
val num_days : from:t -> to_:t -> int
num_days ~from ~to_
gives the number of days that must elapse from a from
to get
to a to_
, i.e. the smallest non-negative number i
such that shift from i = to_
.
val is_sun_or_sat : t -> bool
is_sun_or_sat
returns true if t is Sunday or Saturday
module Stable: sig
.. end
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val bin_t : t Bin_prot.Type_class.t
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (int -> t) Bin_prot.Read.reader
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_writer_t : t Bin_prot.Type_class.writer
of_string s
accepts three-character abbreviations with any capitalization
conversion between ints and weekdays uses the same mapping as Unix.tm_wday.
0 <-> Sun, ... 6 <-> Sat
of_int i
returns i'th weekday if i
is in 0,1,...,6. Otherwise it returns
None.
of_int_exn i
should have i in 0,1,...,6 and returns the i'th weekday.
to_int t
returns an int in 0,1,...6.
shift t i
goes forward (or backward) the specified number of weekdays
num_days ~from ~to_
gives the number of days that must elapse from a from
to get
to a to_
, i.e. the smallest non-negative number i
such that shift from i = to_
.
is_sun_or_sat
returns true if t is Sunday or Saturday