Summary: Limit the scope of what gets included into IStd.ml to only values that we want to shadow. New values go into other files. Also, build istd/ with `Core` open. Reviewed By: mbouaziz Differential Revision: D7382111 fbshipit-source-id: 969f0e8master
parent
774aebcdba
commit
84d3144c98
@ -0,0 +1,20 @@
|
||||
(*
|
||||
* Copyright (c) 2018 - present Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*)
|
||||
|
||||
open! Core
|
||||
|
||||
let reraise_after ~f exn =
|
||||
let backtrace = Caml.Printexc.get_raw_backtrace () in
|
||||
let () = f () in
|
||||
Caml.Printexc.raise_with_backtrace exn backtrace
|
||||
|
||||
|
||||
let reraise_if ~f exn =
|
||||
let backtrace = Caml.Printexc.get_raw_backtrace () in
|
||||
if f () then Caml.Printexc.raise_with_backtrace exn backtrace
|
@ -0,0 +1,18 @@
|
||||
(*
|
||||
* Copyright (c) 2018 - present Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*)
|
||||
|
||||
open! Core
|
||||
|
||||
val reraise_after : f:(unit -> unit) -> exn -> 'a
|
||||
(** Reraise the exception after doing f. Always reraise immediately after catching the exception,
|
||||
otherwise the backtrace can be wrong. *)
|
||||
|
||||
val reraise_if : f:(unit -> bool) -> exn -> unit
|
||||
(** Reraise the exception if f returns true. Always reraise immediately after catching the
|
||||
exception, otherwise the backtrace can be wrong. *)
|
@ -0,0 +1,11 @@
|
||||
(*
|
||||
* Copyright (c) 2018 - present Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*)
|
||||
|
||||
open! Core
|
||||
include Caml.Set.Make (Int)
|
@ -0,0 +1,10 @@
|
||||
(*
|
||||
* Copyright (c) 2018 - present Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*)
|
||||
|
||||
include Caml.Set.S with type elt = int
|
@ -0,0 +1,12 @@
|
||||
(*
|
||||
* Copyright (c) 2018 - present Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*)
|
||||
|
||||
open! Core
|
||||
|
||||
let ( = ) (v1: [> ]) (v2: [> ]) = Polymorphic_compare.( = ) v1 v2
|
@ -0,0 +1,15 @@
|
||||
(*
|
||||
* Copyright (c) 2018 - present Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*)
|
||||
|
||||
open! Core
|
||||
|
||||
(** Open to bring equality [(=)] for polymorphic variants into scope *)
|
||||
|
||||
val ( = ) : ([> ] as 'a) -> 'a -> bool
|
||||
(** Equality for polymorphic variants *)
|
Loading…
Reference in new issue