Module PPrinter.XF

Transformation/Traversal over nodes

val map : ( node -> node ) -> node -> node

Map f over node

val walk : pre:( node -> node ) -> ?post:( node -> node ) -> node -> node

Recursively traverse node, applying pre to each element, then apply post to the result

val fix_ : ?bound:int -> ( 'a -> 'a ) -> 'a -> 'a -> 'a

Bounded fix point combinator, applies f to v until v' = v or bound reaches 0

val fix : ?bound:int -> ( 'a -> 'a ) -> 'a -> 'a

Bounded fix point combinator, applies f to v until f v = v or bound reaches 0

val walk_fix : ?bound:int -> ( node -> node ) -> node -> node

Recursively traverse node applying f to each element until node reaches a fix point or bound reaches 0

val iterated : unit -> 'a

Used to short-circuit from iter

val iter : f:( node -> unit ) -> node -> unit

Iterate over all elements of node applying a (side-effectful) f. Short-circuits when f invokes iterated

val exists : f:( node -> bool ) -> node -> bool

Returns true iff there exists a node in node that satisfies f