File: deriving_Enum.mli

package info (click to toggle)
ocaml-deriving-ocsigen 0.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 628 kB
  • ctags: 1,159
  • sloc: ml: 6,334; makefile: 63; sh: 18
file content (26 lines) | stat: -rw-r--r-- 745 bytes parent folder | download | duplicates (3)
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
module type Enum =
  sig
    type a
    val succ : a -> a
    val pred : a -> a
    val to_enum : int -> a
    val from_enum : a -> int
    val enum_from : a -> a list
    val enum_from_then : a -> a -> a list
    val enum_from_to : a -> a -> a list
    val enum_from_then_to : a -> a -> a -> a list
  end

module Defaults
  (E : sig type a val numbering : (a * int) list end)
  : Enum with type a = E.a

module Defaults' 
  (E : sig type a val from_enum : a -> int val to_enum : int -> a end) 
  (B : Deriving_Bounded.Bounded with type a = E.a)
  : Enum with type a = B.a

module Enum_bool : Enum with type a = bool
module Enum_char : Enum with type a = char
module Enum_int  : Enum with type a = int
module Enum_unit : Enum with type a = unit