Header menu logo OutlineAlgorithm

InteropFSharp Module

F#-friendly API using curried functions and idiomatic constructs.

Functions and values

Function or value Description

CreateTree elements getRank

Full Usage: CreateTree elements getRank

Parameters:
    elements : 'a seq - The sequence of elements to convert.
    getRank : 'a -> int - A function that returns the rank (nesting level) of each element.

Returns: InteropTree<'a> An InteropTree representing the reconstructed hierarchy.

Converts a sequence of elements and rank function into an InteropTree structure.

elements : 'a seq

The sequence of elements to convert.

getRank : 'a -> int

A function that returns the rank (nesting level) of each element.

Returns: InteropTree<'a>

An InteropTree representing the reconstructed hierarchy.

breadthFirstTraversal tree onEnter onExit

Full Usage: breadthFirstTraversal tree onEnter onExit

Parameters:
    tree : InteropTree<'a> - The InteropTree to traverse.
    onEnter : 'a -> unit - Function to call when entering a node with a value.
    onExit : 'a -> unit - Function to call when exiting a node with a value.

Performs breadth-first traversal of an InteropTree. Only nodes with values are visited. Dummy nodes are not visited.

tree : InteropTree<'a>

The InteropTree to traverse.

onEnter : 'a -> unit

Function to call when entering a node with a value.

onExit : 'a -> unit

Function to call when exiting a node with a value.

depthFirstTraversal tree onEnter onExit

Full Usage: depthFirstTraversal tree onEnter onExit

Parameters:
    tree : InteropTree<'a> - The InteropTree to traverse.
    onEnter : 'a -> unit - Function to call when entering a node with a value.
    onExit : 'a -> unit - Function to call when exiting a node with a value.

Performs depth-first traversal of an InteropTree. Only nodes with values are visited. Dummy nodes are not visited.

tree : InteropTree<'a>

The InteropTree to traverse.

onEnter : 'a -> unit

Function to call when entering a node with a value.

onExit : 'a -> unit

Function to call when exiting a node with a value.

traverseWithOutlineIndex tree action

Full Usage: traverseWithOutlineIndex tree action

Parameters:
    tree : InteropTree<'a> - The InteropTree to traverse.
    action : 'a -> int list -> unit - Function to call with each node's value and outline index (e.g., [1; 2; 3]).

Traverses the tree and applies the function to each node with a value, passing its outline index. Dummy nodes are not visited.

tree : InteropTree<'a>

The InteropTree to traverse.

action : 'a -> int list -> unit

Function to call with each node's value and outline index (e.g., [1; 2; 3]).

Type something to start searching.