summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/sigs/FacState.hs
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2013-12-09 16:35:28 +0000
committerJoachim Breitner <mail@joachim-breitner.de>2013-12-09 17:43:13 +0000
commit9e84e1325d1aa182688f0ab23bb894aca177c4dd (patch)
tree0b71c72802ae68ac212c2d28f68bdda13b03f003 /testsuite/tests/stranal/sigs/FacState.hs
parent5a0eabadc77a3c579f92477750e8448ec4d26878 (diff)
downloadhaskell-9e84e1325d1aa182688f0ab23bb894aca177c4dd.tar.gz
Add nested CPR testcase
Diffstat (limited to 'testsuite/tests/stranal/sigs/FacState.hs')
-rw-r--r--testsuite/tests/stranal/sigs/FacState.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/sigs/FacState.hs b/testsuite/tests/stranal/sigs/FacState.hs
new file mode 100644
index 0000000000..470bbd9dcb
--- /dev/null
+++ b/testsuite/tests/stranal/sigs/FacState.hs
@@ -0,0 +1,6 @@
+module FacState where
+
+
+fac :: Int -> a -> (a, Int)
+fac n s | n < 2 = (s,1)
+ | otherwise = case fac (n-1) s of (s',n') -> let n'' = n*n' in n'' `seq` (s',n'')