Personal tools

Talk:Performance/Strictness

From HaskellWiki

< Talk:Performance(Difference between revisions)
Jump to: navigation, search
(reltrocdarb)
 
(removed)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
ricccacm
+
I removed the following:
  +
<blockquote>NB. do not do this if the expression on the right of $! is a variable - that just wastes effort, because it does not eliminate a suspension. The only reason to do this would be if you were eliminating a space leak.</blockquote>
  +
because
  +
<pre-haskell>
  +
test = let
  +
x = undefined
  +
in (const 0) $! x
  +
</pre-haskell>
  +
yields exception and substituting ($) for ($!) yields 0. So ($!) does eliminate a suspension.
  +
--[[User:Beroal|beroal]] 16:58, 16 June 2010 (UTC)

Latest revision as of 16:58, 16 June 2010

I removed the following:

NB. do not do this if the expression on the right of $! is a variable - that just wastes effort, because it does not eliminate a suspension. The only reason to do this would be if you were eliminating a space leak.

because

test = let
  x = undefined
  in (const 0) $! x

yields exception and substituting ($) for ($!) yields 0. So ($!) does eliminate a suspension. --beroal 16:58, 16 June 2010 (UTC)