Documentation for (&&) and (&&) states that they are lazy in their second argument...
[ghc.git] / testsuite / tests / typecheck / should_compile / UnliftedNewtypesUnassociatedFamily.hs
1 {-# LANGUAGE UnliftedNewtypes #-}
2 {-# LANGUAGE DataKinds #-}
3 {-# LANGUAGE TypeFamilies #-}
4 {-# LANGUAGE PolyKinds #-}
5 {-# LANGUAGE MagicHash #-}
6 {-# LANGUAGE UnboxedTuples #-}
7
8 module UnliftedNewtypesUnassociatedFamily where
9
10 import GHC.Int (Int(I#))
11 import GHC.Word (Word(W#))
12 import GHC.Exts (Int#,Word#)
13 import GHC.Exts (TYPE,RuntimeRep(LiftedRep,IntRep,WordRep,TupleRep))
14
15 data family DFT (r :: RuntimeRep) :: TYPE r
16 newtype instance DFT 'IntRep = MkDFT1 Int#
17 newtype instance DFT 'WordRep = MkDFT2 Word#
18 newtype instance DFT ('TupleRep '[ 'IntRep, 'WordRep])
19 = MkDFT3 (# Int#, Word# #)
20 data instance DFT 'LiftedRep = MkDFT4 | MkDFT5
21
22 data family DF :: TYPE (r :: RuntimeRep)
23 newtype instance DF = MkDF1 Int#
24 newtype instance DF = MkDF2 Word#
25 newtype instance DF = MkDF3 (# Int#, Word# #)
26 data instance DF = MkDF4 | MkDF5