ppx_compare Unop

Reviewed By: sblackshear

Differential Revision: D4232382

fbshipit-source-id: 292121c
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent cbec3453a3
commit 122d2b031f

@ -23,18 +23,8 @@ let module F = Format;
type t = type t =
| Neg /** Unary minus */ | Neg /** Unary minus */
| BNot /** Bitwise complement (~) */ | BNot /** Bitwise complement (~) */
| LNot /** Logical Not (!) */; | LNot /** Logical Not (!) */
[@@deriving compare];
let compare o1 o2 =>
switch (o1, o2) {
| (Neg, Neg) => 0
| (Neg, _) => (-1)
| (_, Neg) => 1
| (BNot, BNot) => 0
| (BNot, _) => (-1)
| (_, BNot) => 1
| (LNot, LNot) => 0
};
let equal o1 o2 => compare o1 o2 == 0; let equal o1 o2 => compare o1 o2 == 0;

@ -23,12 +23,11 @@ let module F = Format;
type t = type t =
| Neg /** Unary minus */ | Neg /** Unary minus */
| BNot /** Bitwise complement (~) */ | BNot /** Bitwise complement (~) */
| LNot /** Logical Not (!) */; | LNot /** Logical Not (!) */
[@@deriving compare];
let equal: t => t => bool; let equal: t => t => bool;
let compare: t => t => int;
/** String representation of a unary operator. */ /** String representation of a unary operator. */
let str: t => string; let str: t => string;

Loading…
Cancel
Save