package prbnmcn-basic-structures

  1. Overview
  2. Docs

Shapes: folding and iterating over abstract indexed structures.

type 'a m
type pos

The type of (one-dimensional) positions in a shape.

type 'a t

The type of shapes, parametric in the type of positions.

val mem : 'a t -> 'a m -> bool m

mem p s is true iff p is a position in the shape s.

val pos_equal : 'a t -> 'a m -> 'a m -> bool m

pos_equal s p p' is true iff p and p' are equal positions in the shape s.

val equal : 'a t -> 'a t -> bool m

equal s s' is true iff s and s' describe equal shapes.

module type Storage = Storage with type 'a m = 'a m

First-class mutable storage.

type 'elt storage = (module Storage with type elt = 'elt)
val iter : ('a m -> unit m) -> 'a t -> unit m

Iterate on a shape.

val fold : 'acc storage -> ('a m -> 'acc m -> 'acc m) -> 'a t -> 'acc m -> 'acc m

Fold on a shape.

module Morphism : sig ... end

Shape morphisms, described as a category.


Innovation. Community. Security.