Up

Module type S

A standard incarnation of an interval map for some key type.

The majority of the operations are commented in Operations.

Signature

type ('k, +'v, 'cmp) interval_map
module Interval : sig .. end
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val t_of_sexp : (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a t
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t
include Core_kernel.Std.Applicative.S with type 'a t := 'a t
type 'a t
val return : 'a -> 'a t
val apply : ('a -> 'b) t -> 'a t -> 'b t
val map : 'a t -> f:('a -> 'b) -> 'b t
val map2 : 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c t
val map3 : 'a t -> 'b t -> 'c t -> f:('a -> 'b -> 'c -> 'd) -> 'd t
val all : 'a t list -> 'a list t
val both : 'a t -> 'b t -> ('a * 'b) t
module Applicative_infix : sig .. end
include module type of Applicative_infix
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

same as apply

val (<*) : 'a t -> unit t -> 'a t

same as apply

val (*>) : unit t -> 'a t -> 'a t
include Core_kernel.Std.Monad.S with type 'a t := 'a t
type 'a t
include Monad_intf.S_without_syntax with type 'a t := 'a t
type 'a t

A monad is an abstraction of the concept of sequencing of computations. A value of type 'a monad represents a computation that returns a value of type 'a.

include Monad_intf.Infix with type 'a t := 'a t
type 'a t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

t >>= f returns a computation that sequences the computations represented by two monad elements. The resulting computation first does t to yield a value v, and then runs the computation returned by f v.

val (>>|) : 'a t -> ('a -> 'b) -> 'b t

t >>| f is t >>= (fun a -> return (f a)).

module Monad_infix : Monad_intf.Infix with type 'a t := 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t

bind t f = t >>= f

val return : 'a -> 'a t

return v returns the (trivial) computation that returns v.

val map : 'a t -> f:('a -> 'b) -> 'b t

map t ~f is t >>| f.

val join : 'a t t -> 'a t

join t is t >>= (fun t' -> t').

val ignore_m : 'a t -> unit t

ignore_m t is map t ~f:(fun _ -> ()). ignore_m used to be called ignore, but we decided that was a bad name, because it shadowed the widely used Pervasives.ignore. Some monads still do let ignore = ignore_m for historical reasons.

val all : 'a t list -> 'a list t
val all_ignore : unit t list -> unit t
include Monad_intf.Syntax with type 'a t := 'a t
type 'a t
module Let_syntax : sig .. end
val create : left_of_leftmost:'a -> value_right_of:(Key.t, 'a, Key.comparator_witness) Core_kernel.Std.Map.t -> 'a t
val always : 'a -> 'a t
val unit : unit t

All values of type unit t are equal.

val find : 'v t -> Key.t -> 'v
val change : 'v t -> at:Key.t -> 'v -> 'v t
val map2 : 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c t
val remove_changes_within : 'v t -> Interval.t -> 'v t
val set_within : 'v t -> Interval.t -> 'v -> 'v t
val map_within : 'v t -> Interval.t -> f:('v -> 'v) -> 'v t
val construct_preimage : 'v t -> ('v * Interval.t) Core_kernel.Std.Sequence.t