singletons-base-3.5: tests/compile-and-dump/Singletons/T190.golden
Singletons/T190.hs:0:0:: Splicing declarations
singletons
[d| data T
= T
deriving (Eq, Ord, Enum, Bounded, Show) |]
======>
data T
= T
deriving (Eq, Ord, Enum, Bounded, Show)
type TSym0 :: T
type family TSym0 :: T where
TSym0 = T
type TFHelper_0123456789876543210 :: T -> T -> Bool
type family TFHelper_0123456789876543210 (a :: T) (a :: T) :: Bool where
TFHelper_0123456789876543210 T T = TrueSym0
instance PEq T where
type (==) a a = TFHelper_0123456789876543210 a a
type Compare_0123456789876543210 :: T -> T -> Ordering
type family Compare_0123456789876543210 (a :: T) (a :: T) :: Ordering where
Compare_0123456789876543210 T T = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) NilSym0
instance POrd T where
type Compare a a = Compare_0123456789876543210 a a
type family LamCases_0123456789876543210 (n0123456789876543210 :: GHC.Num.Natural.Natural) a_0123456789876543210 where
LamCases_0123456789876543210 n 'True = TSym0
LamCases_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument"
data LamCases_0123456789876543210Sym0 (n0123456789876543210 :: GHC.Num.Natural.Natural) a_01234567898765432100123456789876543210
where
LamCases_0123456789876543210Sym0KindInference :: SameKind (Apply (LamCases_0123456789876543210Sym0 n0123456789876543210) arg) (LamCases_0123456789876543210Sym1 n0123456789876543210 arg) =>
LamCases_0123456789876543210Sym0 n0123456789876543210 a_01234567898765432100123456789876543210
type instance Apply @_ @_ (LamCases_0123456789876543210Sym0 n0123456789876543210) a_01234567898765432100123456789876543210 = LamCases_0123456789876543210 n0123456789876543210 a_01234567898765432100123456789876543210
instance SuppressUnusedWarnings (LamCases_0123456789876543210Sym0 n0123456789876543210) where
suppressUnusedWarnings
= snd ((,) LamCases_0123456789876543210Sym0KindInference ())
type family LamCases_0123456789876543210Sym1 (n0123456789876543210 :: GHC.Num.Natural.Natural) a_01234567898765432100123456789876543210 where
LamCases_0123456789876543210Sym1 n0123456789876543210 a_01234567898765432100123456789876543210 = LamCases_0123456789876543210 n0123456789876543210 a_01234567898765432100123456789876543210
type ToEnum_0123456789876543210 :: GHC.Num.Natural.Natural -> T
type family ToEnum_0123456789876543210 (a :: GHC.Num.Natural.Natural) :: T where
ToEnum_0123456789876543210 n = Apply (LamCases_0123456789876543210Sym0 n) (Apply (Apply (==@#@$) n) (FromInteger 0))
type FromEnum_0123456789876543210 :: T -> GHC.Num.Natural.Natural
type family FromEnum_0123456789876543210 (a :: T) :: GHC.Num.Natural.Natural where
FromEnum_0123456789876543210 T = FromInteger 0
instance PEnum T where
type ToEnum a = ToEnum_0123456789876543210 a
type FromEnum a = FromEnum_0123456789876543210 a
type MinBound_0123456789876543210 :: T
type family MinBound_0123456789876543210 :: T where
MinBound_0123456789876543210 = TSym0
type MaxBound_0123456789876543210 :: T
type family MaxBound_0123456789876543210 :: T where
MaxBound_0123456789876543210 = TSym0
instance PBounded T where
type MinBound = MinBound_0123456789876543210
type MaxBound = MaxBound_0123456789876543210
type ShowsPrec_0123456789876543210 :: GHC.Num.Natural.Natural
-> T -> GHC.Types.Symbol -> GHC.Types.Symbol
type family ShowsPrec_0123456789876543210 (a :: GHC.Num.Natural.Natural) (a :: T) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where
ShowsPrec_0123456789876543210 _ T a_0123456789876543210 = Apply (Apply ShowStringSym0 "T") a_0123456789876543210
instance PShow T where
type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a
data ST :: T -> Type where ST :: ST (T :: T)
type instance Sing @T = ST
instance SingKind T where
type Demote T = T
fromSing ST = T
toSing T = SomeSing ST
instance SEq T where
(%==) ST ST = STrue
instance SOrd T where
sCompare ST ST
= applySing
(applySing
(applySing (singFun3 @FoldlSym0 sFoldl) (singFun2 @(<>@#@$) (%<>)))
SEQ)
SNil
instance SEnum T where
sToEnum (sN :: Sing n)
= applySing
(singFun1
@(LamCases_0123456789876543210Sym0 n)
(\cases
STrue -> ST
SFalse
-> applySing
(singFun1 @ErrorSym0 sError)
(sing :: Sing "toEnum: bad argument")))
(applySing
(applySing (singFun2 @(==@#@$) (%==)) sN)
(sFromInteger (sing :: Sing 0)))
sFromEnum ST = sFromInteger (sing :: Sing 0)
instance SBounded T where
sMinBound = ST
sMaxBound = ST
instance SShow T where
sShowsPrec
_
ST
(sA_0123456789876543210 :: Sing a_0123456789876543210)
= applySing
(applySing
(singFun2 @ShowStringSym0 sShowString) (sing :: Sing "T"))
sA_0123456789876543210
instance SDecide T where
(%~) ST ST = Proved Refl
instance Eq (ST (z :: T)) where
(==) _ _ = True
instance GHC.Internal.Data.Type.Equality.TestEquality (ST :: T
-> Type) where
GHC.Internal.Data.Type.Equality.testEquality
= Data.Singletons.Decide.decideEquality
instance GHC.Internal.Data.Type.Coercion.TestCoercion (ST :: T
-> Type) where
GHC.Internal.Data.Type.Coercion.testCoercion
= Data.Singletons.Decide.decideCoercion
instance Ord (ST (z :: T)) where
compare _ _ = EQ
deriving instance Show (ST (z :: T))
instance SingI T where
sing = ST