
18 Nov
2007
18 Nov
'07
2:04 p.m.
Lauri Alanko wrote:
Please note that if you're using GHC, bang patterns are often much more convenient than $! or seq when you want to enforce strictness:
http://www.haskell.org/ghc/docs/latest/html/users_guide/bang-patterns.html
Wait, so... f x = x + 1; f $! (a + b) and f !x = x + 1; f (a + b) mean the same thing? Well, you learn something new every day... (I guess wanting a function's arguments to evaluate before the rest of that function is quite a common thing to want. Neat!)