summaryrefslogtreecommitdiff
path: root/libraries/base/tests/dynamic005.hs
blob: e90aeea96043526d862f262d1fbed5a1e62bb460 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Main where

import Data.Typeable

f :: Typeable a => Int -> a -> [TypeRep]
f 0 a = []
f n a = typeOf a : f (n-1) [a]

-- pointwise compare 1000x1000 different TypeReps, there should be no equalities
-- (can be used as a benchmark)

main = print $ length [ t1 | t1 <- replicate 1000 (f 10 ()),
                             t2 <- replicate 1000 (f 10 'a'),
                             t1 == t2 ]