[Haskell-cafe] IO Monad operation madness

Rob Hoelz hoelz at wisc.edu
Thu May 17 19:22:02 EDT 2007


Isaac Dupree <isaacdupree at charter.net> wrote:

> 
> Isaac Dupree wrote:
> >> liftM2 (:)
> >>   (peekCString =<< (linked_list_getdata ptr))
> >>   (linkedListToHaskellStringList =<< linked_list_next ptr)
> 
> formerly missing parenthesis fixed in the above before it bites you :(
> 
> Isaac

Thanks for the help, Isaac.  I didn't know how good of a job GHC did
when optimizing code like that.  I don't have a problem with that code
I wrote as a rule (it doesn't look ugly to me), but I just wanted to
make sure my binding didn't cause crashes.  I like the liftM2 thing,
though; I think I'll go with that.

Thanks,
Rob


More information about the Haskell-Cafe mailing list