Module Middle.Index

Types of indexing operations

type 'a t =
  1. | All
  2. | Single of 'a
  3. | Upfrom of 'a
  4. | Between of 'a * 'a
  5. | MultiIndex of 'a
val map : ('a -> 'b) -> 'a t -> 'b t
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val t_of_sexp : 'a. (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
val sexp_of_t : 'a. ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
val hash_fold_t : 'a. (Ppx_hash_lib.Std.Hash.state -> 'a -> Ppx_hash_lib.Std.Hash.state) -> Ppx_hash_lib.Std.Hash.state -> 'a t -> Ppx_hash_lib.Std.Hash.state
val compare : 'a. ('a -> 'a -> int) -> 'a t -> 'a t -> int
val pp : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a t -> unit
val pp_indices : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a t list -> unit
val bounds : 'a t -> 'a list
val apply : default:'b -> merge:('b -> 'b -> 'b) -> ('a -> 'b) -> 'a t -> 'b

Apply an op over the Index types inner expressions.

  • parameter default

    Value to return for All

  • parameter merge

    Function taking in lhs and rhs of Between and merging their result.

  • parameter op

    a functor to run with inputs of inner exprs

  • parameter ind

    the Index.t to

val folder : string Core.Set.Poly.t -> (string Core.Set.Poly.t -> 'a -> string Core.Set.Poly.t) -> 'a t -> string Core.Set.Poly.t