diff options
Diffstat (limited to 'testsuite/tests/lib/should_run/dynamic005.hs')
-rw-r--r-- | testsuite/tests/lib/should_run/dynamic005.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/lib/should_run/dynamic005.hs b/testsuite/tests/lib/should_run/dynamic005.hs new file mode 100644 index 0000000000..e90aeea960 --- /dev/null +++ b/testsuite/tests/lib/should_run/dynamic005.hs @@ -0,0 +1,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 ] |