package reason

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

reason-3.8.1.tbz
sha256=bfcdbb09f62b4c108f26e6dc380431613e4de4b065df8f14364efe4acea8e414
sha512=61cdf7844349b64190965782103e04eef303ca1f2a7cdc7e20d11189700796a18d2a9d9dbb3ad17eb1363bb1663113da6a22448c017820219757874601f207c3

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.