summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/sigs/T18957.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/stranal/sigs/T18957.hs')
-rw-r--r--testsuite/tests/stranal/sigs/T18957.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/testsuite/tests/stranal/sigs/T18957.hs b/testsuite/tests/stranal/sigs/T18957.hs
index 9781b7cd58..8f4550696d 100644
--- a/testsuite/tests/stranal/sigs/T18957.hs
+++ b/testsuite/tests/stranal/sigs/T18957.hs
@@ -1,11 +1,13 @@
{-# OPTIONS_GHC -O2 -fforce-recomp #-}
{-# LANGUAGE BangPatterns #-}
--- | This ticket is about demand `seq` puts its first argument under and
--- how that affects call demands.
+-- | This ticket is about the demand `seq` puts its first argument under and how
+-- that affects call demands.
module T18957 where
-- | Should put its first argument under head demand
+-- Note that seq' is like seq, but NOINLINE, so the calling code will not have
+-- access to the case binder. That is the difference between 'h1' and 'h2'.
seq' :: a -> b -> b
seq' a b = seq a b
{-# NOINLINE seq' #-}
@@ -18,7 +20,6 @@ g f x = if x < 100 then f x else 200
-- | The first argument is evaluated multiple times, but called at most once
-- every time it's evaluated
h1 :: (Int -> Int) -> Int -> Int
--- Note that seq' is like seq, but NOINLINE. See h2 below why
h1 f x = f `seq'` if x < 100 then f x else 200
-- | Like h1, but using `seq` directly, which will rewrite the call site