package accessor_core

  1. Overview
  2. Docs

Source file accessor_month.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
open! Core
open! Import

type t = Month.t =
  | Jan
  | Feb
  | Mar
  | Apr
  | May
  | Jun
  | Jul
  | Aug
  | Sep
  | Oct
  | Nov
  | Dec
[@@deriving accessors]

let shifted i =
  Accessor.isomorphism
    ~get:(fun month -> Month.shift month i)
    ~construct:(fun month -> Month.shift month (-i))
;;