1. Overview
  2. Docs
Module type
Class type
type 'a t

This functor is essentially there because we use this same interface in different contexts, with different types for 'a t.

1) One use case for it is where 'a X.t = 'a Typerep.t. These interfaces are then part of the type witness built for a type containing a record or a variant in its structure. traverse will give a way of accessing the type representation for the arguments of a variant or record type.

2) Another use case is for building "staged generic computations". In that case, the type 'a X.t is the type of the computation that is being built. traverse returns the computation built for the argument. The interface no longer exports the typerep of the arguments in hopes of enforcing that no typerep traversal happens at runtime if the computation happen to be a function.