[Haskell-cafe] Folding nested foldables -- Known pattern?

Tom Ellis tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk
Tue Jul 12 12:36:22 UTC 2022


Does this help?

    (Foldable f, Foldable g) => Foldable (Compose f g)

https://www.stackage.org/haddock/lts-19.15/base-4.15.1.0/Data-Functor-Compose.html#t:Compose

On Tue, Jul 12, 2022 at 07:09:47AM -0400, Ivan Perez wrote:
> TL;DR: In Copilot, we have an ad-hoc notion of a nestable data structure
> that can be folded into a list. I'm trying to rely on standard classes as
> much as possible. Is there a known class to capture the idea of folding
> nested data structures (e.g., transitive foldable?)


More information about the Haskell-Cafe mailing list