fsprojects/FSharpx.Collections


BinaryTreeZipper

Namespace: FSharpx.Collections.Experimental

TreeZipper original implementation taken from http://blog.xquant.net/?p=156

Nested types and modules

TypeDescription
BinaryTree<'T>

A simple binary tree

BinaryTreeZipper<'T>

The zipper datastructure for binary trees

TreeDirection
TreeZipperDirection

Functions and values

Function or valueDescription
branch x
Signature: x:'?13994 -> BinaryTree<'?13994>
Type parameters: '?13994

Creates a new branch with the label x and two leafs as subbranches

getMove direction
Signature: direction:TreeZipperDirection -> BinaryTreeZipper<'?14046> -> BinaryTreeZipper<'?14046>
Type parameters: '?14046
left z
Signature: z:BinaryTreeZipper<'?14028> -> BinaryTreeZipper<'?14028>
Type parameters: '?14028

Moves the zipper to the left

move directions z
Signature: directions:seq<TreeZipperDirection> -> z:BinaryTreeZipper<'T> -> BinaryTreeZipper<'T>
Type parameters: 'T

Moves the zipper in the directions of the given list

right z
Signature: z:BinaryTreeZipper<'?14030> -> BinaryTreeZipper<'?14030>
Type parameters: '?14030

Moves the zipper to the right

setFocus newFocus zipper
Signature: newFocus:BinaryTree<'?14032> -> zipper:BinaryTreeZipper<'?14032> -> BinaryTreeZipper<'?14032>
Type parameters: '?14032

Modifies the current focus inside the zipper

top z
Signature: z:BinaryTreeZipper<'?14026> -> BinaryTreeZipper<'?14026>
Type parameters: '?14026

Moves the zipper to the top

up z
Signature: z:BinaryTreeZipper<'?14024> -> BinaryTreeZipper<'?14024>
Type parameters: '?14024

Moves the zipper one level up

zipper t
Signature: t:BinaryTree<'?14034> -> BinaryTreeZipper<'?14034>
Type parameters: '?14034

Creates a zipper from a tree

Fork me on GitHub