package refl

  1. Overview
  2. Docs
PPX deriver for reflection

Install

Dune Dependency

Authors

Maintainers

Sources

v0.4.0.tar.gz
sha512=c158970749c1b7bacb8af1f88f0304d8d6cb0f532d3f876734489c3c4220d00f4d5aac6066e6d385ee70e1810ec65ffd47f0197bd5a6080f4d688cb3a386dc0a

doc/src/ppx_refl/common.ml.html

Source file common.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
module OrderedLongident = struct
  type t = Longident.t

  let compare = compare
end

module LongidentSet = Set.Make (OrderedLongident)

module StringSet = Set.Make (String)

module StringMap = Map.Make (String)

module StringHashtbl = Hashtbl.Make (struct
  type t = string

  let equal = String.equal

  let hash = Hashtbl.hash
end)

module IntSet = Set.Make (Int)

module IntMap = Map.Make (Int)

let subst_ident f (type_ident : Longident.t) : Longident.t =
  match type_ident with
  | Lident type_name -> Lident (f type_name)
  | Ldot (path, type_name) -> Ldot (path, f type_name)
  | Lapply _ -> invalid_arg "subst_ident"
OCaml

Innovation. Community. Security.