-
Undocumented
Declaration
Swift
public let root: A -
Undocumented
Declaration
Swift
public let subForest: [Tree<A>] -
Safe downcast.
Declaration
Swift
public static func fix(_ fa: TreeOf<A>) -> Tree<A>Parameters
faValue in higher-kind form.
Return Value
Value cast to Tree.
-
Initializes a tree.
Declaration
Swift
public init(root: A, subForest: [Tree<A>])Parameters
headFirst element for the array.
tailAn array with the rest of elements.
-
Adds a tree as a subtree of
self.The root of
treewill be place directly under the root ofself.Declaration
Swift
public func appendSubTree(_ tree: Tree<A>) -> Tree<A>Parameters
treeThe tree to add under
self.root.Return Value
A tree with the same elements as self with
treeadded as subtree. -
Adds a collection of trees as subtrees of
self.The root of each subtree will be place directly under the root of
self.Declaration
Swift
public func appendSubForest(_ subForest: [Tree<A>]) -> Tree<A>Parameters
subForestA collection of trees to add under
self.rootReturn Value
A tree with the same elements as self with the trees of
subForestadded as subtrees.
Install in Dash
Tree Class Reference