module Day_of_week: sig
.. end
For representing a day of the 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 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_ml.reader
val bin_read_t_ : t Bin_prot.Unsafe_read_c.reader
val bin_read_t__ : (int -> t) Bin_prot.Unsafe_read_c.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_ml.writer
val bin_write_t_ : t Bin_prot.Unsafe_write_c.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
is_sun_or_sat
returns true if t is Sunday or Saturday