[Haskell-cafe] What is the role of $!?

Justin Bailey jgbailey at gmail.com
Wed Nov 14 19:27:11 EST 2007


It's:

  f $! x = x `seq` f x

That is, the argument to the right of $! is forced to evaluate, and
then that value is passed to the function on the left. The function
itself is not strictly evaluated (i.e., f x) I don't believe.

Justin


More information about the Haskell-Cafe mailing list