Summary: Use the new module to represent both Sat/Unsat from Pulse formulas, and FeasiblePath/InfeasiblePath from PulseReport. Reviewed By: jberdine Differential Revision: D25277566 fbshipit-source-id: 9f8412ca9master
parent
581487ec61
commit
98b562c844
@ -0,0 +1,30 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* 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 'a t = Unsat | Sat of 'a
|
||||
|
||||
module Types = struct
|
||||
type nonrec 'a sat_unsat_t = 'a t = Unsat | Sat of 'a
|
||||
end
|
||||
|
||||
let map f = function Unsat -> Unsat | Sat x -> Sat (f x)
|
||||
|
||||
let bind f = function Unsat -> Unsat | Sat x -> f x
|
||||
|
||||
module Import = struct
|
||||
include Types
|
||||
|
||||
let ( >>| ) x f = map f x
|
||||
|
||||
let ( >>= ) x f = bind f x
|
||||
|
||||
let ( let+ ) x f = map f x
|
||||
|
||||
let ( let* ) x f = bind f x
|
||||
end
|
@ -0,0 +1,33 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
[@@@warning "-32-60"]
|
||||
|
||||
type 'a t = Unsat | Sat of 'a
|
||||
|
||||
(** for [open]ing to get [Sat] and [Unsat] in the namespace *)
|
||||
module Types : sig
|
||||
type nonrec 'a sat_unsat_t = 'a t = Unsat | Sat of 'a
|
||||
end
|
||||
|
||||
val map : ('a -> 'b) -> 'a t -> 'b t
|
||||
|
||||
val bind : ('a -> 'b t) -> 'a t -> 'b t
|
||||
|
||||
module Import : sig
|
||||
include module type of Types
|
||||
|
||||
val ( >>| ) : 'a t -> ('a -> 'b) -> 'b t
|
||||
|
||||
val ( >>= ) : 'a t -> ('a -> 'b t) -> 'b t
|
||||
|
||||
val ( let+ ) : 'a t -> ('a -> 'b) -> 'b t
|
||||
|
||||
val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t
|
||||
end
|
Loading…
Reference in new issue