weave: Compositional breadth-first walks

[ bsd3, control, library ] [ Propose Tags ] [ Report a vulnerability ]

An experimental control structure for defining breadth-first walks in trees and graphs in a compositional manner.

Weave is an applicative transformer for multi-level computations. This library actually defines multiple variants of Weave with different performance profiles. The most useful ones are Weave.Lazy and Weave.Oblivious. Two other variants Weave.Strict and Weave.Endless are included mainly as curiosities.

The main application of Weave is to define breadth-first monadic unfolds. Examples of such unfolds for some general-purpose tree structures can be found under the namespace Weave.Unfold, for each variant of Weave.

See also my blog post: Unfolding trees breadth-first in Haskell.

Internally, to avoid duplication, those unfolds are implemented as a Backpack mixin Weave.Unfold. This package might not work with Stack, which doesn't support Backpack. For minimal dependencies and no backpack, the weave-core library is also available, containing only the Weave types.

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>4 && <5), binary-tree (>=0.1 && <0.2), containers (>=0.7 && <0.9), data-fix (>=0.3 && <0.4), transformers (>=0.6 && <0.7), weave, weave-core (>=0.1 && <0.2) [details]
Tested with ghc ==9.10.1, ghc ==9.12.1
License BSD-3-Clause
Author Li-yao Xia
Maintainer lysxia@gmail.com
Category Control
Home page https://gitlab.com/lysxia/weave
Source repo head: git clone https://gitlab.com/lysxia/weave
Uploaded by lyxia at 2025-03-30T11:01:25Z
Distributions
Downloads 4 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
Last success reported on 2025-03-30 [all 1 reports]