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!)

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to