diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2013-12-09 16:35:28 +0000 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2013-12-09 17:43:13 +0000 |
commit | 9e84e1325d1aa182688f0ab23bb894aca177c4dd (patch) | |
tree | 0b71c72802ae68ac212c2d28f68bdda13b03f003 /testsuite/tests/stranal/sigs/FacState.hs | |
parent | 5a0eabadc77a3c579f92477750e8448ec4d26878 (diff) | |
download | haskell-9e84e1325d1aa182688f0ab23bb894aca177c4dd.tar.gz |
Add nested CPR testcase
Diffstat (limited to 'testsuite/tests/stranal/sigs/FacState.hs')
-rw-r--r-- | testsuite/tests/stranal/sigs/FacState.hs | 6 |
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'') |