package lrgrep

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Indexing.SumSource

Sum(L)(R) creates a new type-level set, which is the disjoint sums of the sets L and R. The functor application Sum(L)(R) involves a call to cardinal L.n, thereby fixing the cardinal of the set L, if it was an open-ended set. The cardinal of the set R is not fixed: if R is an open-ended set, then the new set is open-ended as well, and it is still permitted to add new elements to R by calling R.fresh(). Fixing the cardinal of the new set fixes the cardinal of R.

Sourcetype (_, _) n
Sourceval cardinal : 'l cardinal -> 'r cardinal -> ('l, 'r) n cardinal
Sourceval inj_l : 'l index -> ('l, 'r) n index
Sourceval inj_r : 'l cardinal -> 'r index -> ('l, 'r) n index
Sourceval prj : 'l cardinal -> ('l, 'r) n index -> ('l index, 'r index) either
Sourcemodule type S = sig ... end

The signature SUM extends CARDINAL with an explicit isomorphism between the set n and the disjoint sum l + r. The functions inj_l and inj_r convert an index into l or an index into r into an index into n. Conversely, the function prj converts an index into r into either an index into l or an index into r.

Sourcemodule Make (L : CARDINAL) (R : CARDINAL) : S with type l := L.n and type r := R.n
Sourceval make : 'l cardinal -> 'r cardinal -> (module S with type l = 'l and type r = 'r)

The function sum is a value-level analogue of the functor Sum.