package dune-private-libs

  1. Overview
  2. Docs
Private libraries of Dune

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dune-3.21.0.tbz
sha256=e76d4d89368a0a70025193aeaf4f7c5b54031dba3f59bf9d2af1971dc0eceddd
sha512=a7531de073a47f644bd1e06bfb424c50a61d34245e5e0a1f32d8da920437e8fe59246304cb7aec25f797a8dafea876feceeccfe5139502ead4d1ba5c45773ef3

doc/src/dune-private-libs.dune-section/dune_section.ml.html

Source file dune_section.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
30
31
32
33
34
35
36
37
38
39
40
41
42
type t =
  | Lib
  | Lib_root
  | Libexec
  | Libexec_root
  | Bin
  | Sbin
  | Toplevel
  | Share
  | Share_root
  | Etc
  | Doc
  | Stublibs
  | Man
  | Misc

let all =
  [ Lib, "lib"
  ; Lib_root, "lib_root"
  ; Libexec, "libexec"
  ; Libexec_root, "libexec_root"
  ; Bin, "bin"
  ; Sbin, "sbin"
  ; Toplevel, "toplevel"
  ; Share, "share"
  ; Share_root, "share_root"
  ; Etc, "etc"
  ; Doc, "doc"
  ; Stublibs, "stublibs"
  ; Man, "man"
  ; Misc, "misc"
  ]
;;

let to_string t = List.assoc t all

let rec of_string x = function
  | [] -> None
  | (s, x') :: xs -> if x' = x then Some s else of_string x xs
;;

let of_string x = of_string x all