1 -- !! test GEN reps w/ unboxed values in them
2 -- !! NB: it was the static ones that were hosed...
4 module Main ( main ) where
9 putStr (shows (sum ([1..1{-30-}]++[1..1{-40-}]++[11,22])) "\n")
10 putStr (shows (prog 1{-30-} 1{-40-}) "\n")
13 = MkFoo [a] Int# [Int] Int# [(a,Int)] Int#
14 -- The above will cause a *horrible* GEN rep'n.
16 prog :: Int -> Int -> Int
20 list1 = static1 : (map mk_foo [1 .. size_1])
21 list2 = static2 : (map mk_foo [1 .. size_2])
23 I# (add_up 0# list1 (reverse list2))
25 static1 = MkFoo (error "static11") 11# [] 11# (error "static12") 11#
26 static2 = MkFoo (error "static21") 22# [] 22# (error "static22") 22#
32 = MkFoo (error "list1") i# [i,i] i# (error "list2") i#
34 add_up :: Int# -> [Foo a] -> [Foo a] -> Int#
36 add_up acc [] [] = acc
37 add_up acc [] ys = add_up acc ys []
38 add_up acc (x:xs) (y:ys) = add_up (acc +# add x y) xs ys
39 add_up acc (x:xs) [] = add_up acc xs []
41 add :: Foo a -> Foo a -> Int#
42 add (MkFoo _ _ _ _ _ x) (MkFoo _ _ _ _ _ y)