summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/perf/should_run/T2902_A.hs
blob: c0939104f3ca675693488de545098a29133b6aff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

{-# LANGUAGE UnicodeSyntax #-}

module Main (main) where

import T2902_A_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