package core

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

Source file month_intf.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
open! Import

module type Month = sig
  type t =
    | Jan
    | Feb
    | Mar
    | Apr
    | May
    | Jun
    | Jul
    | Aug
    | Sep
    | Oct
    | Nov
    | Dec
  [@@deriving bin_io, hash, equal, quickcheck, sexp, variants]

  include Comparable.S_binable with type t := t
  include Hashable.S_binable with type t := t

  (** [of_string s] accepts three-character abbreviations with three capitalizations
      (e.g. Jan, JAN, and jan). *)
  include Stringable.S with type t := t

  val all : t list

  (** [of_int i] returns the [i]th month if [i] is in 1, 2, ... , 12. Otherwise it
      returns [None]. *)
  val of_int : int -> t option

  val of_int_exn : int -> t

  (** [to_int t] returns an int in 1, 2, ... 12. *)
  val to_int : t -> int

  (** [shift t i] goes forward (or backward) the specified number of months. *)
  val shift : t -> int -> t

  module Export : sig
    type month = t =
      | Jan
      | Feb
      | Mar
      | Apr
      | May
      | Jun
      | Jul
      | Aug
      | Sep
      | Oct
      | Nov
      | Dec
    [@@deprecated
      "[since 2016-06] no longer needed since ocaml is now better at inferring the \
       module where a constructor is defined"]
  end

  module Stable : sig
    module V1 : sig
      type nonrec t = t =
        | Jan
        | Feb
        | Mar
        | Apr
        | May
        | Jun
        | Jul
        | Aug
        | Sep
        | Oct
        | Nov
        | Dec
      [@@deriving sexp, bin_io, compare, hash, equal]

      include
        Stable_module_types.S0
        with type comparator_witness = comparator_witness
         and type t := t
    end
  end
end
OCaml

Innovation. Community. Security.