summaryrefslogtreecommitdiff
path: root/testsuite/tests/unboxedsums/unpack_sums_8.hs
blob: 9946cc4ada41e35f82568b037822cc1703653341 (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
26
27
28
29
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE UnboxedSums #-}

module Main where

data Void
data WithVoid = LV Void | RV
data EnumT = L | R
    deriving Show

data BoxEnum = BoxEnum {-# UNPACK #-} !EnumT
    deriving Show

l = BoxEnum L
r = BoxEnum R

main = do
    print l
    print r


data BoxWithVoid = BoxWithVoid {-# UNPACK #-} !WithVoid
wv = BoxWithVoid (LV undefined)

data BoxVoid = BoxVoid {-# UNPACK #-} Void
bv = BoxVoid undefined

data BoxSum = BoxS {-# UNPACK #-} !(# Int | Char #)
bs = BoxS (# 1 | #)