summaryrefslogtreecommitdiff
path: root/testsuite/tests/perf/space_leaks/T2762A.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/perf/space_leaks/T2762A.hs')
-rw-r--r--testsuite/tests/perf/space_leaks/T2762A.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/perf/space_leaks/T2762A.hs b/testsuite/tests/perf/space_leaks/T2762A.hs
new file mode 100644
index 0000000000..665fa6ef72
--- /dev/null
+++ b/testsuite/tests/perf/space_leaks/T2762A.hs
@@ -0,0 +1,15 @@
+
+module T2762A (input) where
+
+class InputOutput a where
+ input :: String -> (a, String)
+
+instance InputOutput Char where
+ input (x : bs) = (x, bs)
+
+instance InputOutput a => InputOutput [a] where
+ input ('0':bs) = ([], bs)
+ input ('1':bs) = case input bs of
+ (x, bs') ->
+ case input bs' of
+ ~(xs, bs'') -> (x : xs, bs'')