Odoc_model.Fold
SourceThis module allows to fold over odoc values. It is notably used to construct a search database of every relevant item. It appear to be very generic but in reality it is quite specialized to fold over searchable items, and not every kind of odoc value you could fold over.
type item =
| CompilationUnit of Lang.Compilation_unit.t
| TypeDecl of Lang.TypeDecl.t
| Module of Lang.Module.t
| Value of Lang.Value.t
| Exception of Lang.Exception.t
| ClassType of Lang.ClassType.t
| Method of Lang.Method.t
| Class of Lang.Class.t
| Extension of Lang.Extension.t
| ModuleType of Lang.ModuleType.t
| Doc of Paths.Identifier.LabelParent.t * Comment.docs_or_stop
The type of items you can fold over
Below are the folding functions. For items that may contain others, such as signature
, it folds recursively on the sub-items. It does not recurse into internal items.
The LabelParent identifier is used to give an id to the doc entries.
val signature :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.Signature.t ->
'a
val signature_item :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.Signature.item ->
'a
val docs :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Comment.docs_or_stop ->
'a
val include_ :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.Include.t ->
'a
val class_type :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.ClassType.t ->
'a
val class_signature :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.ClassSignature.t ->
'a
val class_signature_item :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.ClassSignature.item ->
'a
val class_ :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.Class.t ->
'a
val module_ :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.Module.t ->
'a
val module_type :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.ModuleType.t ->
'a
val simple_expansion :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.ModuleType.simple_expansion ->
'a
val module_type_expr :
f:('a -> item -> 'a) ->
Paths.Identifier.LabelParent.t ->
'a ->
Lang.ModuleType.expr ->
'a