hadrian: Throw error on duplicate-named flavours
[ghc.git] / testsuite / tests / perf / should_run / T12996.hs
1 {-# OPTIONS_GHC -fno-full-laziness #-}
2
3 module Main where
4
5 import Control.Monad (unless)
6 import Data.Time.Clock
7 import System.IO
8
9 data AppState = AppState [Int]
10
11 cycleState :: [Int] -> [Int]
12 cycleState w = filter (check w) w
13
14 check :: [Int] -> Int -> Bool
15 check world pos = pos `elem` world
16
17 initialSet :: [Int]
18 initialSet = [1]
19
20 main :: IO ()
21 main = appLoop 24 (AppState initialSet)
22
23 appLoop :: Int -> AppState -> IO ()
24 appLoop n s
25 | n == 0 = return ()
26 | otherwise = do let AppState state = s
27 print state
28 appLoop (n-1) $ AppState (cycleState state)
29