package plebeia

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

Mapper over a node

val default_mkview : unit mkview
val map : node: (Node_type.t -> [< `Return of Node_type.t * 'a | `Continue of Node_type.view ]) -> view:'a mkview -> Node_type.t -> Node_type.t * 'a

Mapping over a node with folding

When visiting a node: node is executed with the current node. The function can stop the further traversal by returning `Return _ or continue the traversal by returning `Continue _.

When leaving a node after traversing its sub nodes: When node returns `Continue _ and its subnodes are traversed, then view is executed. It is given a new view consists of the subnodes returned by the traversal and a list of result 'a.

type 'a state

Interleaved mapper state

val interleaved : node: (Node_type.t -> [< `Return of Node_type.t * 'a | `Continue of Node_type.view ]) -> view:'a mkview -> Node_type.t -> ('a state -> [> `Left of 'a state | `Right of Node_type.t * 'a ]) * 'a state

Interleaved version of map. Good to use with Lwt to achieve concurrency