[Haskell-cafe] Why Haskell?

Matthew Bromberg mattcbro at earthlink.net
Sun Jul 23 02:35:41 EDT 2006


 > I used what I thought, initially was an elegant contruction technique in
 > Haskell.  Something like this
 > do
 > ...
 >     sequence $ [ reffill b s | s <- [0..(fi temits)-1], b <- [0..(fi 
nc)-1]]
 > ...(push list on to matrix stack)

Try the sequence_ (note the underscore) function, it should be a big win 
here.
Cheers,
Spencer Janssen

Now thats interesting.  I can see that this function is more appropriate 
since I do not need to retrieve data from the IO monad,
but what I don't understand is why it's actually faster.  I will give it 
a try and test it on a large set to see if things change.
Thanks for the tip.



More information about the Haskell-Cafe mailing list