module Uniplate: Generic_fun_uniplate
val scrap : 'a Ty.T.ty -> 'a -> 'a list * ('a list -> 'a)
Scrap a
returns the list of children of type a
of a value of type a
and a function to replace the children. That function should be given a list of the same size
as the children list.
x == let (children, replace) = scrap a b x in replace children
val children : 'a Ty.T.ty -> 'a -> 'a list
a
of a value of type a
val replace_children : 'a Ty.T.ty -> 'a -> 'a list -> 'a
(Alternative specification: additional children are ignored,
and if not enough are given, only the first ones are changed)
val map_children : 'a Ty.T.ty -> ('a -> 'a) -> 'a -> 'a
val family : 'a Ty.T.ty -> 'a -> 'a list
family
builds a pre-order family where the value is listed before its descendentsval post_family : 'a Ty.T.ty -> 'a -> 'a list
Generic_fun_uniplate.post_family
lists the descendents in post-order: the leaves are first and the root is lastval map_family : 'a Ty.T.ty -> ('a -> 'a) -> 'a -> 'a
val reduce_family : 'a Ty.T.ty -> ('a -> 'a option) -> 'a -> 'a
reduce_family
returns a function that exhaustively
transforms the family of the input. The traversal proceeds
bottom-up, first transforming the families of the
children. If a transformation succeeds then the result is
re-reduce_family-ed.
A post-condition is that the input function returns
None
on all family members of the output.
val para : 'a Ty.T.ty -> ('a -> 'r list -> 'r) -> 'a -> 'r
val traverse_children : 'f Applicative.T.applicative ->
'a Ty.T.ty ->
('a -> ('a, 'f) App.T.app) ->
'a -> ('a, 'f) App.T.app
Generic_fun_uniplate.map_children
val traverse_family : 'f Monad.T.monad ->
'a Ty.T.ty ->
('a -> ('a, 'f) App.T.app) ->
'a -> ('a, 'f) App.T.app
Generic_fun_uniplate.map_family
val mreduce_family : 'f Monad.T.monad ->
'a Ty.T.ty ->
('a -> ('a option, 'f) App.T.app) ->
'a -> ('a, 'f) App.T.app
Generic_fun_uniplate.reduce_family