streamly icon indicating copy to clipboard operation
streamly copied to clipboard

Contra-flattening a Fold

Open rihardsk opened this issue 3 months ago • 2 comments

I hope I'm using the term contravariant here correctly. Basically I want to flatten the inputs of a fold. I.e., I need a function with the following type:

contraFlatten :: Fold m a b -> Fold m [a] b
-- or maybe something more general is possible? e.g.,
-- contraFlatten :: Foldable f => Fold m a b -> Fold m (f a) b

I looked through streamly-core and nothing like this seems to exist?

rihardsk avatar Mar 16 '24 23:03 rihardsk