Zippex v1.0.0-rc.1 Zippex.Meta View Source

The metadata of a Zippex zipper. The Meta struct contains the following fields:

  • is_branch - A function that receives a node and returns true if the node is a branch
  • children - A function that receives a node and returns it's children
  • make_node - A function that receives a node and a list of children and returns a new node

Link to this section Summary

Functions

Applies the children function on a node

Applies the is_branch function on a node

Applies the make_node function on a node and list of children

Returns a new Meta struct

Link to this section Types

Link to this type

children_fun()

View Source
children_fun() :: (element() -> [element()])
Link to this type

is_branch_fun()

View Source
is_branch_fun() :: (element() -> boolean())
Link to this type

make_node_fun()

View Source
make_node_fun() :: (element(), [element()] -> element())
Link to this type

t()

View Source
t() :: %Zippex.Meta{
  children: children_fun(),
  is_branch: is_branch_fun(),
  make_node: make_node_fun()
}

Link to this section Functions

Link to this function

children(meta, element)

View Source
children(t(), element()) :: [element()]

Applies the children function on a node

Link to this function

is_branch(meta, element)

View Source
is_branch(t(), element()) :: boolean()

Applies the is_branch function on a node

Link to this function

make_node(meta, parent, children)

View Source
make_node(t(), element(), [element()]) :: element()

Applies the make_node function on a node and list of children

Link to this function

new(is_branch, children, make_node)

View Source

Returns a new Meta struct