summaryrefslogtreecommitdiff
path: root/testsuite/tests/rep-poly/T20426.hs
blob: c3227f0a8253877c1351d60ac85f00ee8b08e70d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE StandaloneKindSignatures, MagicHash, ExplicitForAll, PolyKinds,
             DataKinds, UnliftedDatatypes, PatternSynonyms, ViewPatterns,
             GADTs #-}

module T20426 where

import GHC.Exts

type LPGADT :: forall (l :: Levity) -> TYPE (BoxedRep l)
data LPGADT l where
  MkLifted   :: Int  -> LPGADT Lifted
  MkUnlifted :: Int# -> LPGADT Unlifted

getInt# :: LPGADT l -> Int#
getInt# (MkLifted (I# i#)) = i#
getInt# (MkUnlifted i#)    = i#