A recursion schemes library for Scala that provides elegant abstractions for folding and unfolding recursive data structures.
Droste is a recursion schemes library for Scala that provides abstractions for folding and unfolding recursive data structures. It implements patterns like histomorphisms and anamorphisms to separate recursion patterns from business logic, making recursive algorithms more composable and reusable.
Scala developers working with complex recursive data structures, functional programming enthusiasts, and those building libraries or applications that require elegant handling of recursion.
Developers choose Droste for its clean separation of recursion patterns from logic, its composable morphisms, and its integration with the Cats ecosystem, offering a more maintainable approach to recursive programming compared to manual recursion.
recursion schemes for cats; to iterate is human, to recurse, divine
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables easy assembly and combination of algebras and coalgebras, as demonstrated in the Fibonacci example where anamorphism and histomorphism are seamlessly integrated using scheme.ghylo.
Offers ready-to-use recursion patterns like dyna for dynamorphisms, simplifying common recursive operations without custom implementation, as shown in the alternative Fibonacci calculation.
Supports zipping multiple algebras to compute multiple results in one traversal, illustrated by the fused example that calculates Fibonacci and sum of squares simultaneously.
Provides Athema, a math expression parser/processor, as an extensive reference for applying recursion schemes in practical scenarios, enhancing learnability and adoption.
Requires deep understanding of advanced recursion schemes like histomorphisms and anamorphisms, which are not intuitive without prior exposure to functional programming theory, making onboarding difficult for many developers.
As a niche library derived from other projects like recursion-schemes and Matryoshka, it has a smaller community and less documentation, and the disclaimer hints at potential experimental nature or instability.
The abstraction layers for composability and fusion might introduce runtime overhead compared to hand-rolled recursive functions, which could be problematic for performance-sensitive applications, though not explicitly benchmarked.