DDC compiler and effects; better than Haskell? (was Re: [Haskell-cafe] unsafeDestructiveAssign?)

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Thu Aug 13 00:12:55 EDT 2009


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 at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090812/16fba715/PGP.bin


More information about the Haskell-Cafe mailing list