PartialOrder

Reviewed By: ngorogiannis

Differential Revision: D8350238

fbshipit-source-id: 3ec4f34
master
Mehdi Bouaziz 7 years ago committed by Facebook Github Bot
parent 7f839ae962
commit 21ced6af62

@ -690,19 +690,7 @@ module Bound = struct
let eq : t -> t -> bool = fun x y -> le x y && le y x
let xcompare ~lhs ~rhs =
let ller = le lhs rhs in
let rlel = le rhs lhs in
match (ller, rlel) with
| true, true ->
`Equal
| true, false ->
`LeftSmallerThanRight
| false, true ->
`RightSmallerThanLeft
| false, false ->
`NotComparable
let xcompare = PartialOrder.of_le ~le
let remove_max_int : t -> t =
fun x ->

@ -0,0 +1,25 @@
(*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
open! IStd
type total = [`LeftSmallerThanRight | `Equal | `RightSmallerThanLeft]
type t = [total | `NotComparable]
let of_le ~le ~lhs ~rhs =
let ller = le lhs rhs in
let rlel = le rhs lhs in
match (ller, rlel) with
| true, true ->
`Equal
| true, false ->
`LeftSmallerThanRight
| false, true ->
`RightSmallerThanLeft
| false, false ->
`NotComparable

@ -0,0 +1,14 @@
(*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
open! IStd
type total = [`LeftSmallerThanRight | `Equal | `RightSmallerThanLeft]
type t = [total | `NotComparable]
val of_le : le:('a -> 'a -> bool) -> lhs:'a -> rhs:'a -> t
Loading…
Cancel
Save