purescript-foldable-traversable
purescript-foldable-traversable copied to clipboard
foldRecM
Generalize from Data.Array
:
foldRecM :: forall m a b. Foldable f => MonadRec m => (a -> b -> m a) -> a -> f b -> m a
Sadly, it seems that any generalized version of this will be hopelessly inefficient, repeatedly running a left fold over the collection.
This should eventually be doable in a reasonable once (if?) default member implementations are part of the language, so leaving it up for now.
I want this too.