This module generalizes structure traverse (*walking*). This is done via a `walk(..)` function that recieves a user-defined `getter(..)` and returns a *walker*.
`walk(getter)(state, ...nodes) -> state`
`walk(getter, state)(...nodes) -> state`
`walk(getter, state, ...nodes) -> state`
- Recieves a `getter` function a `state` and a list of `nodes`,
- Iterates through `nodes` calling the `getter(..)` per node, threading the `state` through each call,
- Returns the `state` when there are no more `nodes`.
`getter(state, node, next, down, stop) -> state`
- Recieves `state`, `node` and three control functions: `next`, `down` and `stop`,
- Can process `node` and `state`,
- Can queue nodes for walking via `next(...nodes)`
- Can walk nodes directly via `down(state, ...nodes) -> state`
- Can abbort *walking* and return a state via `stop()` or `stop(state)`
Queue `nodes` for walking. The queued nodes will get *walked* after this level of nodes is done (i.e. the `getter(..)` is called for each node on level).
`down(state, ...nodes) -> state`
Walk `nodes` and return `state`. The nodes will get *walked* immidiately.
`stop()`
`stop(state)`
Stop walking and return `state`. The passed `state` is directly returned from the *walker*.
*Note that `stop(..)` behaves in a similar manner to `return`, i.e. execution is aborted immidiately.*
## Examples
Sum all the values of a nested array (breadth-first)...
```javascript
var sum = walk(function(res, node, next){
return node instanceof Array ?
// compensate for that next(..) returns undefined...