summaryrefslogtreecommitdiff
path: root/testsuite/tests/perf/should_run/T2902_B.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/perf/should_run/T2902_B.hs')
-rw-r--r--testsuite/tests/perf/should_run/T2902_B.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/perf/should_run/T2902_B.hs b/testsuite/tests/perf/should_run/T2902_B.hs
new file mode 100644
index 0000000000..c6558c625b
--- /dev/null
+++ b/testsuite/tests/perf/should_run/T2902_B.hs
@@ -0,0 +1,18 @@
+
+{-# LANGUAGE UnicodeSyntax #-}
+
+module Main (main) where
+
+import T2902_B_PairingSum
+
+f :: Int -> PSum Int Int
+f n = unions $ fmap g [1..n]
+ where
+ g m = unions $ fmap fromList
+ [ zip [m..n] $ repeat 1
+ , zip [m,2+m..n] $ repeat 2
+ , zip [m,3+m..n] $ repeat 3
+ ]
+
+main ∷ IO ()
+main = print $ take 20 $ toList $ f 20