package reason

  1. Overview
  2. Docs
Reason: Syntax & Toolchain for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

reason-3.8.0.tbz
sha256=9478724b01767320064ba950ddea24c5df0eefdcdd8ff1324ba9ccd646258979
sha512=c5dcec810a1981b78b19271a8a255f4087628514725d6818419b141be6346a62b28fe8d0f10855efe420ede2839bfe562aa5abf21f29d66250e5c0d02323d6d8

doc/src/reason.ocaml-migrate-parsetree/ast_408_helper.ml.html

Source file ast_408_helper.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
module Misc = struct

  let find_in_path = Misc.find_in_path
  let find_in_path_uncap = Misc.find_in_path_uncap

  type ref_and_value = R : 'a ref * 'a -> ref_and_value
  let protect_refs =
    let set_refs l = List.iter (fun (R (r, v)) -> r := v) l in
    fun refs f ->
      let backup = List.map (fun (R (r, _)) -> R (r, !r)) refs in
      set_refs refs;
      match f () with
      | x           -> set_refs backup; x
      | exception e -> set_refs backup; raise e

  let may_map = Stdlib0.Option.map

  module Stdlib = struct
    module String = struct
      include String
      module Map = Map.Make (String)
    end
  end
end
OCaml

Innovation. Community. Security.