Menu

📰
0

Hylic: A composable recursion system for Rust (separating tree, fold, and execution)

Reddit r/rust·u/simleiiiii·about 1 month ago
#C1JenIk9
#hylic#recursion#docs#fold#article#discussion
Reading 0:00
15s threshold

Hylic: A composable recursion system for Rust (separating tree, fold, and execution) I’ve been working on a Rust library, and published yesterday, that decomposes general recursion, into three independent parts: * **Tree/Graph** structure (*Nodes* and their child nodes; DAG only) * **Fold** logic (three closures: *initialize* intermediate result (heap), *accumulate* child results onto heap + a *finalize* step into the result type) * **Execution** strategy (Executor) Project location: * Docs: [https://hylic-recursion.github.io/hylic-docs/intro.html](https://hylic-recursion.github.io/hylic-docs/intro.html) * Github: [https://github.com/hylic-recursion/hylic](https://github.com/hylic-recursion/hylic) The idea is that instead of writing recursive functions directly, you define: 1. how your structure expands (`Treeish `, morally `N -> &[N]`) 2. how results are combined (`Fold ` -- init+accumulate+finalize) 3.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More