Cartesian trees as balanced representations for sequences.
Each sequence representation has a different run-time type, with associated checks for its operations.
Result type for all "meta level" operations returning an X
.
public func eval(e : Exp<Val_>) : R.Result<Val_, Error_>
Evaluate expression into a result.
public func haveArray(v : Val<Val_>) : Result<[(Val<Val_>, Meta)], Val_>
Check canonical array forms.
public func streamOfArray(v : Val<Val_>) : EvalResult<Val_>
Transforms an array into a stream.
public func treeSize(t : Tree<Val_>) : Nat
number of elms; ignore internal nodes
public func treeLevel(t : Tree<Val_>) : Nat
public func resultPairSplit(r : EvalResult<Val_>) : Result<(Val<Val_>, Val<Val_>), Val_>
public func resultPair(v1 : Val<Val_>, v2 : Val<Val_>) : EvalResult<Val_>
public func treeOfStreamRec(
parentLevel : ?Nat,
s : Stream<Val_>,
tree : Tree<Val_>
) : EvalResult<Val_>
Transforms a stream into a tree.
public func treeOfStream(s : Val<Val_>) : EvalResult<Val_>
Transforms a stream into a tree.