diff --git a/sledge/lib/import/import.ml b/sledge/lib/import/import.ml index d966aa860..f2111e1ea 100644 --- a/sledge/lib/import/import.ml +++ b/sledge/lib/import/import.ml @@ -30,6 +30,7 @@ exception Not_found = Caml.Not_found include Stdio module Command = Core.Command module Hash_queue = Core_kernel.Hash_queue +include Import0 (** Tuple operations *) @@ -45,11 +46,6 @@ let ( $ ) f g x = f x ; g x let ( $> ) x f = 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 *) let fail = Trace.fail @@ -135,20 +131,6 @@ let filter_map_preserving_phys_equal filter_map t ~f = in 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 include Base.Option diff --git a/sledge/lib/import/import.mli b/sledge/lib/import/import.mli index feb2bb099..0609a4f20 100644 --- a/sledge/lib/import/import.mli +++ b/sledge/lib/import/import.mli @@ -29,6 +29,7 @@ external ( != ) : 'a -> 'a -> bool = "%noteq" include module type of Stdio module Command = Core.Command module Hash_queue = Core_kernel.Hash_queue +include module type of Import0 (** Tuple operations *) @@ -63,14 +64,6 @@ val ( <$ ) : ('a -> unit) -> 'a -> 'a (** Apply and ignore function: [f <$ x] is exactly equivalent to [f x ; x]. 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 *) 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 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 include module type of Base.Option diff --git a/sledge/lib/import/import0.ml b/sledge/lib/import/import0.ml new file mode 100644 index 000000000..b77e48dac --- /dev/null +++ b/sledge/lib/import/import0.ml @@ -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