[sledge] Move some general type definitions from Import to Import0

Summary: In preparation for splitting Import into multiple modules.

Reviewed By: ngorogiannis

Differential Revision: D20482768

fbshipit-source-id: 1efd33863
master
Josh Berdine 5 years ago committed by Facebook GitHub Bot
parent 124a1fed20
commit 9c77d7b2a4

@ -30,6 +30,7 @@ exception Not_found = Caml.Not_found
include Stdio include Stdio
module Command = Core.Command module Command = Core.Command
module Hash_queue = Core_kernel.Hash_queue module Hash_queue = Core_kernel.Hash_queue
include Import0
(** Tuple operations *) (** Tuple operations *)
@ -45,11 +46,6 @@ let ( $ ) f g x = f x ; g x
let ( $> ) x f = f x ; x let ( $> ) x f = f x ; x
let ( <$ ) f x = f x ; x let ( <$ ) f x = f x ; x
(** Pretty-printing *)
type 'a pp = Formatter.t -> 'a -> unit
type ('a, 'b) fmt = ('a, 'b) Trace.fmt
(** Failures *) (** Failures *)
let fail = Trace.fail let fail = Trace.fail
@ -135,20 +131,6 @@ let filter_map_preserving_phys_equal filter_map t ~f =
in in
if !change then t' else t if !change then t' else t
module type Applicative_syntax = sig
type 'a t
val ( let+ ) : 'a t -> ('a -> 'b) -> 'b t
val ( and+ ) : 'a t -> 'b t -> ('a * 'b) t
end
module type Monad_syntax = sig
include Applicative_syntax
val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t
val ( and* ) : 'a t -> 'b t -> ('a * 'b) t
end
module Option = struct module Option = struct
include Base.Option include Base.Option

@ -29,6 +29,7 @@ external ( != ) : 'a -> 'a -> bool = "%noteq"
include module type of Stdio include module type of Stdio
module Command = Core.Command module Command = Core.Command
module Hash_queue = Core_kernel.Hash_queue module Hash_queue = Core_kernel.Hash_queue
include module type of Import0
(** Tuple operations *) (** Tuple operations *)
@ -63,14 +64,6 @@ val ( <$ ) : ('a -> unit) -> 'a -> 'a
(** Apply and ignore function: [f <$ x] is exactly equivalent to [f x ; x]. (** Apply and ignore function: [f <$ x] is exactly equivalent to [f x ; x].
Left associative. *) Left associative. *)
(** Pretty-printing *)
(** Pretty-printer for argument type. *)
type 'a pp = Formatter.t -> 'a -> unit
(** Format strings. *)
type ('a, 'b) fmt = ('a, 'b) Trace.fmt
(** Failures *) (** Failures *)
exception Unimplemented of string exception Unimplemented of string
@ -110,20 +103,6 @@ val or_error : ('a -> 'b) -> 'a -> unit -> 'b or_error
module Invariant : module type of Base.Invariant module Invariant : module type of Base.Invariant
module type Applicative_syntax = sig
type 'a t
val ( let+ ) : 'a t -> ('a -> 'b) -> 'b t
val ( and+ ) : 'a t -> 'b t -> ('a * 'b) t
end
module type Monad_syntax = sig
include Applicative_syntax
val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t
val ( and* ) : 'a t -> 'b t -> ('a * 'b) t
end
module Option : sig module Option : sig
include module type of Base.Option include module type of Base.Option

@ -0,0 +1,28 @@
(*
* 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.
*)
(** Pretty-printer for argument type. *)
type 'a pp = Format.formatter -> 'a -> unit
(** Format strings. *)
type ('a, 'b) fmt = ('a, 'b) Trace.fmt
module Sexp = Sexplib.Sexp
module type Applicative_syntax = sig
type 'a t
val ( let+ ) : 'a t -> ('a -> 'b) -> 'b t
val ( and+ ) : 'a t -> 'b t -> ('a * 'b) t
end
module type Monad_syntax = sig
include Applicative_syntax
val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t
val ( and* ) : 'a t -> 'b t -> ('a * 'b) t
end
Loading…
Cancel
Save