[Haskell-cafe] What is the role of $!?
andrewcoppin at btinternet.com
Sun Nov 18 14:04:15 EST 2007
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:
f x = x + 1; f $! (a + b)
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!)
More information about the Haskell-Cafe