purescript-foldable-traversable icon indicating copy to clipboard operation
purescript-foldable-traversable copied to clipboard

foldRecM

Open matthewleon opened this issue 6 years ago • 3 comments

Generalize from Data.Array:

foldRecM :: forall m a b. Foldable f => MonadRec m => (a -> b -> m a) -> a -> f b -> m a

matthewleon avatar Feb 10 '18 21:02 matthewleon

Sadly, it seems that any generalized version of this will be hopelessly inefficient, repeatedly running a left fold over the collection.

matthewleon avatar Feb 10 '18 22:02 matthewleon

This should eventually be doable in a reasonable once (if?) default member implementations are part of the language, so leaving it up for now.

matthewleon avatar Feb 12 '18 00:02 matthewleon

I want this too.

jamesdbrock avatar Jan 30 '22 15:01 jamesdbrock