TreeLeaf.ts overview
Leaf node of a tree: a value of type B with no children. Companion of | MTreeNonLeaf; both are unioned into `| `MTree.Type.
Quickstart
Example (Create a leaf)
import * as MTreeLeaf from "@parischap/effect-lib/MTreeLeaf"
const leaf = MTreeLeaf.make(42)
console.log(leaf.value) // 42
Exports Grouped by Category
Constructors
make
Builds a leaf node carrying value.
Example
import * as MTreeLeaf from "@parischap/effect-lib/MTreeLeaf"
console.log(MTreeLeaf.make(42).value) // 42
Signature
declare const make: <B>(value: B) => Type<B>
Models
Type (class)
Leaf node holding a value of type B. Has no children.
Signature
declare class Type<B> {
private constructor({ value }: MTypes.Data<Type<B>>)
}
make (static method)
Static constructor
Signature
declare const make: <B>(params: MTypes.Data<Type<B>>) => Type<B>
[MData.idSymbol] (method)
Returns the id of this
Signature
declare const [MData.idSymbol]: () => string | (() => string)
Module markers
moduleTag
Module tag.
Signature
declare const moduleTag: "@parischap/effect-lib/Tree/TreeLeaf/"