You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 13, 2026. It is now read-only.
We should be able to provide functions like benda.util.to_tree(xs: Iterable[T]) -> Tree[T] native-optimized, though I'm not sure on the interface format.
We should also be able to iterate over Tree and List easily and
native-optimizedly with functions like benda.util.from_tree(tree: Tree[T]) -> Iterator[T]:
I'm inclined to think we should not provide this __iter__ behavior directly on
the types of Tree.Node etc because this behavior is not that obvious and is
implemented as separate functions on Bend's side.
We should be able to provide functions like
benda.util.to_tree(xs: Iterable[T]) -> Tree[T]native-optimized, though I'm not sure on the interface format.We should also be able to iterate over
TreeandListeasily andnative-optimizedly with functions like
benda.util.from_tree(tree: Tree[T]) -> Iterator[T]:I'm inclined to think we should not provide this
__iter__behavior directly onthe types of
Tree.Nodeetc because this behavior is not that obvious and isimplemented as separate functions on Bend's side.
benda.util.to_nat(int) -> NatthrowsValueError("Negative integer")benda.util.from_nat(Nat) -> intbenda.util.to_string(str) -> Stringbenda.util.from_string(String) -> strbenda.util.to_list(Iterable[T]) -> List[T]benda.util.from_list(List[T]) -> list[T]benda.util.iter_list(List[T]) -> Iterator[T]benda.util.iter_tree(Tree[T]) -> Iterator[T]Note:
strconversion from and toStringshould probably also automatic, but we can'tdo that for
int↔Natbecause they don't map directly.