
On Aug 12, 2009, at 23:46 , Ben Lippmeier wrote:
Dan Doel wrote:
Off hand, I'd say I don't write foo and fooM versions of functions much in actual programs, either. Such duplication goes into libraries...
Note the lack of Data.Map.mapM and Data.Map.foldM. Want to apply a monadic computation to all the elements of a Data.Map? Convert it to a list and back..
If Data.Map were a Monad, then the Monad mapM and foldM would work. It's not (can't represent Ord constraint on keys), so you have to translate into a monad to use monad functions. I don't know if Oleg's restricted monads, which *can* represent Data.Map, provide something similar. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH