foundation icon indicating copy to clipboard operation
foundation copied to clipboard

mapM_ needs work

Open ndmitchell opened this issue 7 years ago • 3 comments

It should not be defined on top of mapM as that requires O(n) stack space.

It should also require an Applicative constraint, not a Monad.

ndmitchell avatar Jun 11 '17 09:06 ndmitchell

You mean sequenceA_ ? Or do you mean going away from base's legacy API and providing only one set of function compatible to the most common denominator between Applicative and Monad (i.e. Applicative, since Monad implies Applicative now a day)?

NicolasDP avatar Jun 11 '17 09:06 NicolasDP

hmm Looks like I need to spend more time reading your blog posts: http://neilmitchell.blogspot.ch/2015/09/making-sequencemapm-for-io-take-o1-stack.html

NicolasDP avatar Jun 11 '17 09:06 NicolasDP

Should probably also be in Foldable not Mappable. And should Foldable should be a superclass of Mappable. And should Mappable just be Traversable.

ndmitchell avatar Jun 11 '17 10:06 ndmitchell