Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / parser / should_run / readRun004.hs
1 {-# LANGUAGE UnboxedTuples, MagicHash #-}
2
3 -- should_run to make sure linking succeeds
4 -- (curried unboxed tuples with both boxed
5 -- and unboxed components).
6 -- See #1509; also Note [Primop wrappers] in Id.lhs
7
8 import GHC.Exts
9
10 main = do
11 case curried 9.0## 't'# of
12 (# i#, u@(), d1#, c1#, f#, w#, d2#, c2# #)
13 -> print ( I# i#, u, D# d1#, C# c1#, F# f#, W# w#, D# d2#, C# c2# )
14 print $ map_ ((#,#) True) ['a','b','c']
15
16 -- try NOINLINE to make sure the currying isn't eliminated
17 -- too soon, but also test the other one without NOINLINE
18 -- for variety of testing
19 {-# NOINLINE curried #-}
20 curried :: Double# -> Char# ->
21 (# Int#, (), Double#, Char#, Float#, Word#, Double#, Char# #)
22 curried = (#,,,,,,,#) 3# () 4.0## 'f'# 5.0# 32##
23
24 map_ :: (a -> (# b, c #)) -> [a] -> [(b,c)]
25 map_ f [] = []
26 map_ f (a:as) = case f a of
27 (# b, c #) -> (b, c) : map_ f as
28