package mrmime

  1. Overview
  2. Docs
type t =
  1. | Jan
  2. | Feb
  3. | Mar
  4. | Apr
  5. | May
  6. | Jun
  7. | Jul
  8. | Aug
  9. | Sep
  10. | Oct
  11. | Nov
  12. | Dec
    (*

    Type of month according RFC 822 / RFC 2822 / RFC 5322.

    *)

Constructors.

val jan : t
val feb : t
val mar : t
val apr : t
val may : t
val jun : t
val jul : t
val aug : t
val sep : t
val oct : t
val nov : t
val dec : t
val to_int : t -> int

to_int m is the number of the month m.

val of_int : int -> (t, [ `Msg of string ]) Stdlib.result

of_int n returns month of the number n. If n < 1 or n > 12, it returns an error.

val of_int_exn : int -> t

of_int_exn is an alias on of_int except that if user give an invalid number, we raise an exception.

val to_string : t -> string

to_stirng v returns a well-formed string from a month v.

val of_string : string -> (t, [ `Msg of string ]) Stdlib.result

of_string v returns a month from a well-formed string v. Process is case-sensitive, month needs to be capitalized (eg. "Nov").

val of_string_exn : string -> t

of_string v returns a month from a well-formed string v. Process is case-sensitive, month needs to be capitalized (eg. "Nov").

  • raises [Invalid_argument]

    when v is an invalid month.

val v : string -> t

Alias of of_string_exn.

Pretty-printers.

val pp : Stdlib.Format.formatter -> t -> unit

Equals.

val equal : t -> t -> bool
OCaml

Innovation. Community. Security.