summaryrefslogtreecommitdiff
path: root/testsuite/tests/cpranal/should_compile/T18109.hs
blob: 5c52a187c9b2204269009bdb3bd9667063d5b363 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{-# OPTIONS_GHC -O2 -fforce-recomp -dno-typeable-binds #-}

-- | These are all examples where the CPR worker should not return an unboxed
-- singleton tuple of the field, but rather the single field directly.
-- This is OK if the field indeed terminates quickly;
-- see Note [No unboxed tuple for single, unlifted transit var]
module T18109 where

data F = F (Int -> Int)

f :: Int -> F
f n = F (+n)
{-# NOINLINE f #-}

data T = T (Int, Int)

g :: T -> T
g t@(T p) = p `seq` t
{-# NOINLINE g #-}

data U = U ![Int]

h :: Int -> U
h n = U [0..n]
{-# NOINLINE h #-}