packages feed

singletons-base-3.0: 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
    type TFHelper_0123456789876543210Sym0 :: (~>) T ((~>) T Bool)
    data TFHelper_0123456789876543210Sym0 :: (~>) T ((~>) T Bool)
      where
        TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
      suppressUnusedWarnings
        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
    type TFHelper_0123456789876543210Sym1 :: T -> (~>) T Bool
    data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: T) :: (~>) T Bool
      where
        TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
      suppressUnusedWarnings
        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
    type TFHelper_0123456789876543210Sym2 :: T -> T -> Bool
    type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: T) (a0123456789876543210 :: T) :: Bool where
      TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
    instance PEq T where
      type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 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 ThenCmpSym0) EQSym0) NilSym0
    type Compare_0123456789876543210Sym0 :: (~>) T ((~>) T Ordering)
    data Compare_0123456789876543210Sym0 :: (~>) T ((~>) T Ordering)
      where
        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
                                                        Compare_0123456789876543210Sym0 a0123456789876543210
    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
      suppressUnusedWarnings
        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
    type Compare_0123456789876543210Sym1 :: T -> (~>) T Ordering
    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: T) :: (~>) T Ordering
      where
        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
      suppressUnusedWarnings
        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
    type Compare_0123456789876543210Sym2 :: T -> T -> Ordering
    type family Compare_0123456789876543210Sym2 (a0123456789876543210 :: T) (a0123456789876543210 :: T) :: Ordering where
      Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
    instance POrd T where
      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
    type family Case_0123456789876543210 n t where
      Case_0123456789876543210 n 'True = TSym0
      Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument"
    type ToEnum_0123456789876543210 :: GHC.Types.Nat -> T
    type family ToEnum_0123456789876543210 (a :: GHC.Types.Nat) :: T where
      ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0))
    type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat T
    data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat T
      where
        ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
      suppressUnusedWarnings
        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
    type ToEnum_0123456789876543210Sym1 :: GHC.Types.Nat -> T
    type family ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: T where
      ToEnum_0123456789876543210Sym1 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210
    type FromEnum_0123456789876543210 :: T -> GHC.Types.Nat
    type family FromEnum_0123456789876543210 (a :: T) :: GHC.Types.Nat where
      FromEnum_0123456789876543210 T = FromInteger 0
    type FromEnum_0123456789876543210Sym0 :: (~>) T GHC.Types.Nat
    data FromEnum_0123456789876543210Sym0 :: (~>) T GHC.Types.Nat
      where
        FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
      suppressUnusedWarnings
        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
    type FromEnum_0123456789876543210Sym1 :: T -> GHC.Types.Nat
    type family FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: T) :: GHC.Types.Nat where
      FromEnum_0123456789876543210Sym1 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210
    instance PEnum T where
      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
    type MinBound_0123456789876543210 :: T
    type family MinBound_0123456789876543210 :: T where
      MinBound_0123456789876543210 = TSym0
    type MinBound_0123456789876543210Sym0 :: T
    type family MinBound_0123456789876543210Sym0 :: T where
      MinBound_0123456789876543210Sym0 = MinBound_0123456789876543210
    type MaxBound_0123456789876543210 :: T
    type family MaxBound_0123456789876543210 :: T where
      MaxBound_0123456789876543210 = TSym0
    type MaxBound_0123456789876543210Sym0 :: T
    type family MaxBound_0123456789876543210Sym0 :: T where
      MaxBound_0123456789876543210Sym0 = MaxBound_0123456789876543210
    instance PBounded T where
      type MinBound = MinBound_0123456789876543210Sym0
      type MaxBound = MaxBound_0123456789876543210Sym0
    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
                                          -> T -> GHC.Types.Symbol -> GHC.Types.Symbol
    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: T) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where
      ShowsPrec_0123456789876543210 _ T a_0123456789876543210 = Apply (Apply ShowStringSym0 "T") a_0123456789876543210
    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol))
    data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol))
      where
        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
      suppressUnusedWarnings
        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
                                              -> (~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol)
    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: (~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol)
      where
        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
      suppressUnusedWarnings
        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
                                              -> T -> (~>) GHC.Types.Symbol GHC.Types.Symbol
    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: T) :: (~>) GHC.Types.Symbol GHC.Types.Symbol
      where
        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
      suppressUnusedWarnings
        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
    type ShowsPrec_0123456789876543210Sym3 :: GHC.Types.Nat
                                              -> T -> GHC.Types.Symbol -> GHC.Types.Symbol
    type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: T) (a0123456789876543210 :: GHC.Types.Symbol) :: GHC.Types.Symbol where
      ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
    instance PShow T where
      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
    data ST :: T -> GHC.Types.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
      (%==) ::
        forall (t1 :: T) (t2 :: T).
        Sing t1
        -> Sing t2
           -> Sing (Apply (Apply ((==@#@$) :: TyFun T ((~>) T Bool)
                                              -> GHC.Types.Type) t1) t2)
      (%==) ST ST = STrue
    instance SOrd T where
      sCompare ::
        forall (t1 :: T) (t2 :: T).
        Sing t1
        -> Sing t2
           -> Sing (Apply (Apply (CompareSym0 :: TyFun T ((~>) T Ordering)
                                                 -> GHC.Types.Type) t1) t2)
      sCompare ST ST
        = (applySing
             ((applySing
                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
                    ((singFun2 @ThenCmpSym0) sThenCmp)))
                SEQ))
            SNil
    instance SEnum T where
      sToEnum ::
        forall (t :: GHC.Types.Nat).
        Sing t
        -> Sing (Apply (Data.Singletons.Base.Enum.ToEnumSym0 :: TyFun GHC.Types.Nat T
                                                                -> GHC.Types.Type) t)
      sFromEnum ::
        forall (t :: T).
        Sing t
        -> Sing (Apply (Data.Singletons.Base.Enum.FromEnumSym0 :: TyFun T GHC.Types.Nat
                                                                  -> GHC.Types.Type) t)
      sToEnum (sN :: Sing n)
        = (id
             @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0)))))
            (case
                 (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
                   (sFromInteger (sing :: Sing 0))
             of
               STrue -> ST
               SFalse -> sError (sing :: Sing "toEnum: bad argument"))
      sFromEnum ST = sFromInteger (sing :: Sing 0)
    instance SBounded T where
      sMinBound :: Sing (MinBoundSym0 :: T)
      sMaxBound :: Sing (MaxBoundSym0 :: T)
      sMinBound = ST
      sMaxBound = ST
    instance SShow T where
      sShowsPrec ::
        forall (t1 :: GHC.Types.Nat) (t2 :: T) (t3 :: GHC.Types.Symbol).
        Sing t1
        -> Sing t2
           -> Sing t3
              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol))
                                                             -> GHC.Types.Type) t1) t2) t3)
      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 Data.Type.Equality.TestEquality (ST :: T
                                                    -> GHC.Types.Type) where
      Data.Type.Equality.testEquality
        = Data.Singletons.Decide.decideEquality
    instance Data.Type.Coercion.TestCoercion (ST :: T
                                                    -> GHC.Types.Type) where
      Data.Type.Coercion.testCoercion
        = Data.Singletons.Decide.decideCoercion
    deriving instance Show (ST (z :: T))
    instance SingI T where
      sing = ST