package core_kernel

  1. Overview
  2. No Docs
Industrial strength alternative to OCaml's standard library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.14.2.tar.gz
sha256=66f5353964d35a994ec7fdc88fe60ae5d497ac89a8042786f3e37d9e2202ce4b
md5=ede2f6d22eaa8320f88bac67d41b5cff

doc/src/core_kernel.total_map/enumeration.ml.html

Source file enumeration.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
open! Core_kernel
open! Import

type ('a, 'b) t = { all : 'a list }

module type S =
  Enumeration_intf.S with type ('a, 'witness) enumeration := ('a, 'witness) t

module type S_fc =
  Enumeration_intf.S_fc with type ('a, 'witness) enumeration := ('a, 'witness) t

module Make (T : sig
    type t [@@deriving enumerate]
  end) =
struct
  type enumeration_witness

  let enumeration = T.{ all }
end

let make (type t) ~all =
  (module struct
    type enumerable_t = t
    type enumeration_witness

    let enumeration = { all }
  end : S_fc
    with type enumerable_t = t)
;;