Permalink
Browse files

Only expose `(|>)` when using OCaml pre-4.01

OCaml 4.01 introduces the `(|>)` operator in `Pervasives`. As a result,
when `open`ing the `QuickCheck_util` module, a warning is given because
a name is aliased.

This in turn causes a compiler error since warnings-as-errors is
enabled.

This commit uses `optcomp` so `(|>)` is not part of the module when
compiled using OCaml >= 4.01.
  • Loading branch information...
NicolasT committed Oct 25, 2013
1 parent 60dc5c0 commit 5bb1d0a00658f3c5a153cff019ba98a9537f5f42
Showing with 4 additions and 0 deletions.
  1. +2 −0 src/quickCheck_util.ml
  2. +2 −0 src/quickCheck_util.mli
View
@@ -63,7 +63,9 @@ let join_string_list lst sep =
let sum_int = List.fold_left (+) 0;;
#if ocaml_version < (4, 01)
let ( |> ) x f = f x
#endif
let ( <| ) f x = f x
let ( % ) f g = fun x -> f (g x)
View
@@ -38,7 +38,9 @@ val join_string_list : string list -> string -> string
val sum_int : int list -> int
#if ocaml_version < (4, 01)
val ( |> ) : 'a -> ('a -> 'b) -> 'b
#endif
val ( <| ) : ('a -> 'b) -> 'a -> 'b
val ( % ) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b

0 comments on commit 5bb1d0a

Please sign in to comment.