package lrgrep

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

Module Index.UnsafeSource

To implement clever datastructures (for instance using bit-packing), it is useful to manipulate indices as integers. See IndexSet or IndexMap for usage examples. Refrain from using it if you are not sure of what you are doing since this can break some modular abstraction.

To be safe, the coerced module should never introduce new indices; that is, it should not return an index that it did not receive as argument.

Sourcemodule type T = sig ... end
Sourcemodule type F = functor (X : T) -> sig ... end
Sourcemodule Int : T with type 'a t = int
Sourcemodule Index : T with type 'a t = 'a index
Sourcemodule Coerce (F : F) (X : F(Int).S) : F(Index).S