diff --git a/singletons-base/tests/compile-and-dump/GradingClient/Database.golden b/singletons-base/tests/compile-and-dump/GradingClient/Database.golden index da108e88..2ce09e73 100644 --- a/singletons-base/tests/compile-and-dump/GradingClient/Database.golden +++ b/singletons-base/tests/compile-and-dump/GradingClient/Database.golden @@ -27,58 +27,16 @@ GradingClient/Database.hs:(0,0)-(0,0): Splicing declarations TFHelper_0123456789876543210 Zero (Succ _) = FalseSym0 TFHelper_0123456789876543210 (Succ _) Zero = FalseSym0 TFHelper_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210 - type TFHelper_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Nat @((~>) Nat Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: Nat -> (~>) Nat Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Nat @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: Nat -> Nat -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq Nat where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: Nat -> Nat -> Ordering type family Compare_0123456789876543210 (a :: Nat) (a :: Nat) :: Ordering where Compare_0123456789876543210 Zero Zero = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) NilSym0 Compare_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0) Compare_0123456789876543210 Zero (Succ _) = LTSym0 Compare_0123456789876543210 (Succ _) Zero = GTSym0 - type Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering) - data Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Nat @((~>) Nat Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: Nat -> (~>) Nat Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Nat @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: Nat -> Nat -> Ordering - type family Compare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd Nat where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a data SNat :: Nat -> Type where SZero :: SNat (Zero :: Nat) @@ -534,29 +492,8 @@ GradingClient/Database.hs:(0,0)-(0,0): Splicing declarations TFHelper_0123456789876543210 (VEC _ _) STRING = FalseSym0 TFHelper_0123456789876543210 (VEC _ _) NAT = FalseSym0 TFHelper_0123456789876543210 (VEC a_0123456789876543210 a_0123456789876543210) (VEC b_0123456789876543210 b_0123456789876543210) = Apply (Apply (&&@#@$) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210) - type TFHelper_0123456789876543210Sym0 :: (~>) U ((~>) U Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) U ((~>) U Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @U @((~>) U Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: U -> (~>) U Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: U) :: (~>) U Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @U @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: U -> U -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: U) (a0123456789876543210 :: U) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq U where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type ShowsPrec_0123456789876543210 :: GHC.Num.Natural.Natural -> U -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 (a :: GHC.Num.Natural.Natural) (a :: U) (a :: Symbol) :: Symbol where @@ -564,41 +501,8 @@ GradingClient/Database.hs:(0,0)-(0,0): Splicing declarations ShowsPrec_0123456789876543210 _ STRING a_0123456789876543210 = Apply (Apply ShowStringSym0 "STRING") a_0123456789876543210 ShowsPrec_0123456789876543210 _ NAT a_0123456789876543210 = Apply (Apply ShowStringSym0 "NAT") a_0123456789876543210 ShowsPrec_0123456789876543210 p_0123456789876543210 (VEC arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "VEC ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) U ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) U ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) U ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> (~>) U ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) U ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @U @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: GHC.Num.Natural.Natural - -> U -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: U) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (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.Num.Natural.Natural - -> U -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: U) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow U where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a type ShowsPrec_0123456789876543210 :: GHC.Num.Natural.Natural -> AChar -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 (a :: GHC.Num.Natural.Natural) (a :: AChar) (a :: Symbol) :: Symbol where @@ -628,41 +532,8 @@ GradingClient/Database.hs:(0,0)-(0,0): Splicing declarations ShowsPrec_0123456789876543210 _ CX a_0123456789876543210 = Apply (Apply ShowStringSym0 "CX") a_0123456789876543210 ShowsPrec_0123456789876543210 _ CY a_0123456789876543210 = Apply (Apply ShowStringSym0 "CY") a_0123456789876543210 ShowsPrec_0123456789876543210 _ CZ a_0123456789876543210 = Apply (Apply ShowStringSym0 "CZ") a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) AChar ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) AChar ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) AChar ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> (~>) AChar ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) AChar ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @AChar @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: GHC.Num.Natural.Natural - -> AChar -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: AChar) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (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.Num.Natural.Natural - -> AChar -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: AChar) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow AChar where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a type TFHelper_0123456789876543210 :: AChar -> AChar -> Bool type family TFHelper_0123456789876543210 (a :: AChar) (a :: AChar) :: Bool where TFHelper_0123456789876543210 CA CA = TrueSym0 @@ -1341,29 +1212,8 @@ GradingClient/Database.hs:(0,0)-(0,0): Splicing declarations TFHelper_0123456789876543210 CZ CX = FalseSym0 TFHelper_0123456789876543210 CZ CY = FalseSym0 TFHelper_0123456789876543210 CZ CZ = TrueSym0 - type TFHelper_0123456789876543210Sym0 :: (~>) AChar ((~>) AChar Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) AChar ((~>) AChar Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @AChar @((~>) AChar Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: AChar -> (~>) AChar Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: AChar) :: (~>) AChar Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @AChar @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: AChar -> AChar -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: AChar) (a0123456789876543210 :: AChar) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq AChar where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a sLookup :: (forall (t :: [AChar]) (t :: Schema). Sing t diff --git a/singletons-base/tests/compile-and-dump/Promote/Newtypes.golden b/singletons-base/tests/compile-and-dump/Promote/Newtypes.golden index c1b60f6e..8d84c774 100644 --- a/singletons-base/tests/compile-and-dump/Promote/Newtypes.golden +++ b/singletons-base/tests/compile-and-dump/Promote/Newtypes.golden @@ -48,26 +48,5 @@ Promote/Newtypes.hs:(0,0)-(0,0): Splicing declarations type TFHelper_0123456789876543210 :: Foo -> Foo -> Bool type family TFHelper_0123456789876543210 (a :: Foo) (a :: Foo) :: Bool where TFHelper_0123456789876543210 (Foo a_0123456789876543210) (Foo b_0123456789876543210) = Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210 - type TFHelper_0123456789876543210Sym0 :: (~>) Foo ((~>) Foo Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) Foo ((~>) Foo Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Foo @((~>) Foo Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: Foo -> (~>) Foo Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Foo) :: (~>) Foo Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Foo @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: Foo -> Foo -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Foo) (a0123456789876543210 :: Foo) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq Foo where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a diff --git a/singletons-base/tests/compile-and-dump/Singletons/BoundedDeriving.golden b/singletons-base/tests/compile-and-dump/Singletons/BoundedDeriving.golden index d27721e8..384bbc4e 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/BoundedDeriving.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/BoundedDeriving.golden @@ -88,78 +88,48 @@ Singletons/BoundedDeriving.hs:(0,0)-(0,0): Splicing declarations type MinBound_0123456789876543210 :: Foo1 type family MinBound_0123456789876543210 :: Foo1 where MinBound_0123456789876543210 = Foo1Sym0 - type MinBound_0123456789876543210Sym0 :: Foo1 - type family MinBound_0123456789876543210Sym0 :: Foo1 where - MinBound_0123456789876543210Sym0 = MinBound_0123456789876543210 type MaxBound_0123456789876543210 :: Foo1 type family MaxBound_0123456789876543210 :: Foo1 where MaxBound_0123456789876543210 = Foo1Sym0 - type MaxBound_0123456789876543210Sym0 :: Foo1 - type family MaxBound_0123456789876543210Sym0 :: Foo1 where - MaxBound_0123456789876543210Sym0 = MaxBound_0123456789876543210 instance PBounded Foo1 where - type MinBound = MinBound_0123456789876543210Sym0 - type MaxBound = MaxBound_0123456789876543210Sym0 + type MinBound = MinBound_0123456789876543210 + type MaxBound = MaxBound_0123456789876543210 type MinBound_0123456789876543210 :: Foo2 type family MinBound_0123456789876543210 :: Foo2 where MinBound_0123456789876543210 = ASym0 - type MinBound_0123456789876543210Sym0 :: Foo2 - type family MinBound_0123456789876543210Sym0 :: Foo2 where - MinBound_0123456789876543210Sym0 = MinBound_0123456789876543210 type MaxBound_0123456789876543210 :: Foo2 type family MaxBound_0123456789876543210 :: Foo2 where MaxBound_0123456789876543210 = ESym0 - type MaxBound_0123456789876543210Sym0 :: Foo2 - type family MaxBound_0123456789876543210Sym0 :: Foo2 where - MaxBound_0123456789876543210Sym0 = MaxBound_0123456789876543210 instance PBounded Foo2 where - type MinBound = MinBound_0123456789876543210Sym0 - type MaxBound = MaxBound_0123456789876543210Sym0 + type MinBound = MinBound_0123456789876543210 + type MaxBound = MaxBound_0123456789876543210 type MinBound_0123456789876543210 :: forall a. Foo3 a type family MinBound_0123456789876543210 @a :: Foo3 a where MinBound_0123456789876543210 @a = Apply Foo3Sym0 MinBoundSym0 - type MinBound_0123456789876543210Sym0 :: forall a. Foo3 a - type family MinBound_0123456789876543210Sym0 @a :: Foo3 a where - MinBound_0123456789876543210Sym0 = MinBound_0123456789876543210 type MaxBound_0123456789876543210 :: forall a. Foo3 a type family MaxBound_0123456789876543210 @a :: Foo3 a where MaxBound_0123456789876543210 @a = Apply Foo3Sym0 MaxBoundSym0 - type MaxBound_0123456789876543210Sym0 :: forall a. Foo3 a - type family MaxBound_0123456789876543210Sym0 @a :: Foo3 a where - MaxBound_0123456789876543210Sym0 = MaxBound_0123456789876543210 instance PBounded (Foo3 a) where - type MinBound = MinBound_0123456789876543210Sym0 - type MaxBound = MaxBound_0123456789876543210Sym0 + type MinBound = MinBound_0123456789876543210 + type MaxBound = MaxBound_0123456789876543210 type MinBound_0123456789876543210 :: forall a b. Foo4 a b type family MinBound_0123456789876543210 @a @b :: Foo4 a b where MinBound_0123456789876543210 @a @b = Foo41Sym0 - type MinBound_0123456789876543210Sym0 :: forall a b. Foo4 a b - type family MinBound_0123456789876543210Sym0 @a @b :: Foo4 a b where - MinBound_0123456789876543210Sym0 = MinBound_0123456789876543210 type MaxBound_0123456789876543210 :: forall a b. Foo4 a b type family MaxBound_0123456789876543210 @a @b :: Foo4 a b where MaxBound_0123456789876543210 @a @b = Foo42Sym0 - type MaxBound_0123456789876543210Sym0 :: forall a b. Foo4 a b - type family MaxBound_0123456789876543210Sym0 @a @b :: Foo4 a b where - MaxBound_0123456789876543210Sym0 = MaxBound_0123456789876543210 instance PBounded (Foo4 a b) where - type MinBound = MinBound_0123456789876543210Sym0 - type MaxBound = MaxBound_0123456789876543210Sym0 + type MinBound = MinBound_0123456789876543210 + type MaxBound = MaxBound_0123456789876543210 type MinBound_0123456789876543210 :: Pair type family MinBound_0123456789876543210 :: Pair where MinBound_0123456789876543210 = Apply (Apply PairSym0 MinBoundSym0) MinBoundSym0 - type MinBound_0123456789876543210Sym0 :: Pair - type family MinBound_0123456789876543210Sym0 :: Pair where - MinBound_0123456789876543210Sym0 = MinBound_0123456789876543210 type MaxBound_0123456789876543210 :: Pair type family MaxBound_0123456789876543210 :: Pair where MaxBound_0123456789876543210 = Apply (Apply PairSym0 MaxBoundSym0) MaxBoundSym0 - type MaxBound_0123456789876543210Sym0 :: Pair - type family MaxBound_0123456789876543210Sym0 :: Pair where - MaxBound_0123456789876543210Sym0 = MaxBound_0123456789876543210 instance PBounded Pair where - type MinBound = MinBound_0123456789876543210Sym0 - type MaxBound = MaxBound_0123456789876543210Sym0 + type MinBound = MinBound_0123456789876543210 + type MaxBound = MaxBound_0123456789876543210 data SFoo1 :: Foo1 -> Type where SFoo1 :: SFoo1 (Foo1 :: Foo1) type instance Sing @Foo1 = SFoo1 instance SingKind Foo1 where diff --git a/singletons-base/tests/compile-and-dump/Singletons/Classes.golden b/singletons-base/tests/compile-and-dump/Singletons/Classes.golden index 0e577cc2..1c90c323 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/Classes.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/Classes.golden @@ -162,143 +162,36 @@ Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations type TFHelper_0123456789876543210 :: forall a. a -> a -> Ordering type family TFHelper_0123456789876543210 @a (a :: a) (a :: a) :: Ordering where TFHelper_0123456789876543210 @a (a_0123456789876543210 :: a) (a_0123456789876543210 :: a) = Apply (Apply MycompareSym0 a_0123456789876543210) a_0123456789876543210 - type TFHelper_0123456789876543210Sym0 :: forall a. (~>) a ((~>) a Ordering) - data TFHelper_0123456789876543210Sym0 :: (~>) a ((~>) a Ordering) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @a @((~>) a Ordering) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: forall a. a - -> (~>) a Ordering - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: a) :: (~>) a Ordering - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @a @Ordering (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: forall a. a - -> a -> Ordering - type family TFHelper_0123456789876543210Sym2 @a (a0123456789876543210 :: a) (a0123456789876543210 :: a) :: Ordering where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 class PMyOrd a where type family Mycompare (arg :: a) (arg :: a) :: Ordering type family (<=>) (arg :: a) (arg :: a) :: Ordering - type (<=>) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (<=>) a a = TFHelper_0123456789876543210 a a type Mycompare_0123456789876543210 :: Nat -> Nat -> Ordering type family Mycompare_0123456789876543210 (a :: Nat) (a :: Nat) :: Ordering where Mycompare_0123456789876543210 'Zero 'Zero = EQSym0 Mycompare_0123456789876543210 'Zero ('Succ _) = LTSym0 Mycompare_0123456789876543210 ('Succ _) 'Zero = GTSym0 Mycompare_0123456789876543210 ('Succ n) ('Succ m) = Apply (Apply MycompareSym0 m) n - type Mycompare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering) - data Mycompare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering) - where - Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) => - Mycompare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Nat @((~>) Nat Ordering) Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym0KindInference ()) - type Mycompare_0123456789876543210Sym1 :: Nat -> (~>) Nat Ordering - data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Ordering - where - Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) => - Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Nat @Ordering (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym1KindInference ()) - type Mycompare_0123456789876543210Sym2 :: Nat -> Nat -> Ordering - type family Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) :: Ordering where - Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PMyOrd Nat where - type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a + type Mycompare a a = Mycompare_0123456789876543210 a a type Mycompare_0123456789876543210 :: () -> () -> Ordering type family Mycompare_0123456789876543210 (a :: ()) (a :: ()) :: Ordering where Mycompare_0123456789876543210 _ a_0123456789876543210 = Apply (Apply ConstSym0 EQSym0) a_0123456789876543210 - type Mycompare_0123456789876543210Sym0 :: (~>) () ((~>) () Ordering) - data Mycompare_0123456789876543210Sym0 :: (~>) () ((~>) () Ordering) - where - Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) => - Mycompare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @() @((~>) () Ordering) Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym0KindInference ()) - type Mycompare_0123456789876543210Sym1 :: () -> (~>) () Ordering - data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: ()) :: (~>) () Ordering - where - Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) => - Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @() @Ordering (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym1KindInference ()) - type Mycompare_0123456789876543210Sym2 :: () -> () -> Ordering - type family Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: ()) (a0123456789876543210 :: ()) :: Ordering where - Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PMyOrd () where - type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a + type Mycompare a a = Mycompare_0123456789876543210 a a type Mycompare_0123456789876543210 :: Foo -> Foo -> Ordering type family Mycompare_0123456789876543210 (a :: Foo) (a :: Foo) :: Ordering where Mycompare_0123456789876543210 a_0123456789876543210 a_0123456789876543210 = Apply (Apply FooCompareSym0 a_0123456789876543210) a_0123456789876543210 - type Mycompare_0123456789876543210Sym0 :: (~>) Foo ((~>) Foo Ordering) - data Mycompare_0123456789876543210Sym0 :: (~>) Foo ((~>) Foo Ordering) - where - Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) => - Mycompare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Foo @((~>) Foo Ordering) Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym0KindInference ()) - type Mycompare_0123456789876543210Sym1 :: Foo -> (~>) Foo Ordering - data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: Foo) :: (~>) Foo Ordering - where - Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) => - Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Foo @Ordering (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym1KindInference ()) - type Mycompare_0123456789876543210Sym2 :: Foo -> Foo -> Ordering - type family Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Foo) (a0123456789876543210 :: Foo) :: Ordering where - Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PMyOrd Foo where - type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a + type Mycompare a a = Mycompare_0123456789876543210 a a type TFHelper_0123456789876543210 :: Foo2 -> Foo2 -> Bool type family TFHelper_0123456789876543210 (a :: Foo2) (a :: Foo2) :: Bool where TFHelper_0123456789876543210 F F = TrueSym0 TFHelper_0123456789876543210 G G = TrueSym0 TFHelper_0123456789876543210 F G = FalseSym0 TFHelper_0123456789876543210 G F = FalseSym0 - type TFHelper_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Foo2 @((~>) Foo2 Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: Foo2 -> (~>) Foo2 Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Foo2) :: (~>) Foo2 Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Foo2 @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: Foo2 -> Foo2 -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Foo2) (a0123456789876543210 :: Foo2) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq Foo2 where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a sFooCompare :: (forall (t :: Foo) (t :: Foo). Sing t @@ -365,8 +258,7 @@ Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations infix 4 %<=> default (%<=>) :: (forall (t :: a) (t :: a). - ((Apply (Apply (<=>@#@$) t) t :: Ordering) - ~ Apply (Apply TFHelper_0123456789876543210Sym0 t) t) => + (((<=>) t t :: Ordering) ~ TFHelper_0123456789876543210 t t) => Sing t -> Sing t -> Sing (Apply (Apply (<=>@#@$) t) t :: Ordering) :: Type) @@ -452,58 +344,15 @@ Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations Mycompare_0123456789876543210 'F 'F = EQSym0 Mycompare_0123456789876543210 'F _ = LTSym0 Mycompare_0123456789876543210 _ _ = GTSym0 - type Mycompare_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Ordering) - data Mycompare_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Ordering) - where - Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) => - Mycompare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Foo2 @((~>) Foo2 Ordering) Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym0KindInference ()) - type Mycompare_0123456789876543210Sym1 :: Foo2 - -> (~>) Foo2 Ordering - data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: Foo2) :: (~>) Foo2 Ordering - where - Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) => - Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Foo2 @Ordering (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym1KindInference ()) - type Mycompare_0123456789876543210Sym2 :: Foo2 -> Foo2 -> Ordering - type family Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Foo2) (a0123456789876543210 :: Foo2) :: Ordering where - Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PMyOrd Foo2 where - type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a + type Mycompare a a = Mycompare_0123456789876543210 a a type Compare_0123456789876543210 :: Foo2 -> Foo2 -> Ordering type family Compare_0123456789876543210 (a :: Foo2) (a :: Foo2) :: Ordering where Compare_0123456789876543210 'F 'F = EQSym0 Compare_0123456789876543210 'F _ = LTSym0 Compare_0123456789876543210 _ _ = GTSym0 - type Compare_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Ordering) - data Compare_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Foo2 @((~>) Foo2 Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: Foo2 -> (~>) Foo2 Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Foo2) :: (~>) Foo2 Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Foo2 @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: Foo2 -> Foo2 -> Ordering - type family Compare_0123456789876543210Sym2 (a0123456789876543210 :: Foo2) (a0123456789876543210 :: Foo2) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd Foo2 where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations singletons [d| data Nat' = Zero' | Succ' Nat' @@ -540,30 +389,8 @@ Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations Mycompare_0123456789876543210 Zero' (Succ' _) = LTSym0 Mycompare_0123456789876543210 (Succ' _) Zero' = GTSym0 Mycompare_0123456789876543210 (Succ' n) (Succ' m) = Apply (Apply MycompareSym0 m) n - type Mycompare_0123456789876543210Sym0 :: (~>) Nat' ((~>) Nat' Ordering) - data Mycompare_0123456789876543210Sym0 :: (~>) Nat' ((~>) Nat' Ordering) - where - Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) => - Mycompare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Nat' @((~>) Nat' Ordering) Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym0KindInference ()) - type Mycompare_0123456789876543210Sym1 :: Nat' - -> (~>) Nat' Ordering - data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: Nat') :: (~>) Nat' Ordering - where - Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) => - Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Nat' @Ordering (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym1KindInference ()) - type Mycompare_0123456789876543210Sym2 :: Nat' -> Nat' -> Ordering - type family Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Nat') (a0123456789876543210 :: Nat') :: Ordering where - Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PMyOrd Nat' where - type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a + type Mycompare a a = Mycompare_0123456789876543210 a a data SNat' :: Nat' -> Type where SZero' :: SNat' (Zero' :: Nat') diff --git a/singletons-base/tests/compile-and-dump/Singletons/Classes2.golden b/singletons-base/tests/compile-and-dump/Singletons/Classes2.golden index c6a70a38..5cd7579a 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/Classes2.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/Classes2.golden @@ -34,31 +34,8 @@ Singletons/Classes2.hs:(0,0)-(0,0): Splicing declarations Mycompare_0123456789876543210 ZeroFoo (SuccFoo _) = LTSym0 Mycompare_0123456789876543210 (SuccFoo _) ZeroFoo = GTSym0 Mycompare_0123456789876543210 (SuccFoo n) (SuccFoo m) = Apply (Apply MycompareSym0 m) n - type Mycompare_0123456789876543210Sym0 :: (~>) NatFoo ((~>) NatFoo Ordering) - data Mycompare_0123456789876543210Sym0 :: (~>) NatFoo ((~>) NatFoo Ordering) - where - Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) => - Mycompare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @NatFoo @((~>) NatFoo Ordering) Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym0KindInference ()) - type Mycompare_0123456789876543210Sym1 :: NatFoo - -> (~>) NatFoo Ordering - data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: NatFoo) :: (~>) NatFoo Ordering - where - Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) => - Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @NatFoo @Ordering (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Mycompare_0123456789876543210Sym1KindInference ()) - type Mycompare_0123456789876543210Sym2 :: NatFoo - -> NatFoo -> Ordering - type family Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: NatFoo) (a0123456789876543210 :: NatFoo) :: Ordering where - Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PMyOrd NatFoo where - type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a + type Mycompare a a = Mycompare_0123456789876543210 a a data SNatFoo :: NatFoo -> Type where SZeroFoo :: SNatFoo (ZeroFoo :: NatFoo) diff --git a/singletons-base/tests/compile-and-dump/Singletons/DataValues.golden b/singletons-base/tests/compile-and-dump/Singletons/DataValues.golden index 9adfd233..f0e56bb1 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/DataValues.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/DataValues.golden @@ -56,45 +56,8 @@ Singletons/DataValues.hs:(0,0)-(0,0): Splicing declarations -> Pair a b -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 @a @b (a :: GHC.Num.Natural.Natural) (a :: Pair a b) (a :: Symbol) :: Symbol where ShowsPrec_0123456789876543210 @a @b (p_0123456789876543210 :: GHC.Num.Natural.Natural) (Pair arg_0123456789876543210 arg_0123456789876543210 :: Pair a b) (a_0123456789876543210 :: Symbol) = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Pair ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: forall a - b. (~>) GHC.Num.Natural.Natural ((~>) (Pair a b) ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) (Pair a b) ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) (Pair a b) ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: forall a - b. GHC.Num.Natural.Natural - -> (~>) (Pair a b) ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) (Pair a b) ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Pair a b) @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: forall a - b. GHC.Num.Natural.Natural - -> Pair a b -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Pair a b) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym2KindInference ()) - type ShowsPrec_0123456789876543210Sym3 :: forall a - b. GHC.Num.Natural.Natural - -> Pair a b -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 @a @b (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Pair a b) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow (Pair a b) where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a sAList :: Sing @_ AListSym0 sTuple :: Sing @_ TupleSym0 sComplex :: Sing @_ ComplexSym0 diff --git a/singletons-base/tests/compile-and-dump/Singletons/EmptyShowDeriving.golden b/singletons-base/tests/compile-and-dump/Singletons/EmptyShowDeriving.golden index 37961efc..5db7414f 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/EmptyShowDeriving.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/EmptyShowDeriving.golden @@ -11,41 +11,8 @@ Singletons/EmptyShowDeriving.hs:(0,0)-(0,0): Splicing declarations -> Foo -> GHC.Types.Symbol -> GHC.Types.Symbol type family ShowsPrec_0123456789876543210 (a :: GHC.Num.Natural.Natural) (a :: Foo) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where ShowsPrec_0123456789876543210 _ v_0123456789876543210 a_0123456789876543210 = Apply (Case_0123456789876543210 v_0123456789876543210 a_0123456789876543210 v_0123456789876543210) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) Foo ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) Foo ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) Foo ((~>) GHC.Types.Symbol GHC.Types.Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> (~>) Foo ((~>) GHC.Types.Symbol GHC.Types.Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) Foo ((~>) 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 @Foo @((~>) GHC.Types.Symbol GHC.Types.Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: GHC.Num.Natural.Natural - -> Foo -> (~>) GHC.Types.Symbol GHC.Types.Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Foo) :: (~>) 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 @GHC.Types.Symbol @GHC.Types.Symbol (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.Num.Natural.Natural - -> Foo -> GHC.Types.Symbol -> GHC.Types.Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Foo) (a0123456789876543210 :: GHC.Types.Symbol) :: GHC.Types.Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow Foo where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a data SFoo :: Foo -> Type type instance Sing @Foo = SFoo instance SingKind Foo where diff --git a/singletons-base/tests/compile-and-dump/Singletons/EnumDeriving.golden b/singletons-base/tests/compile-and-dump/Singletons/EnumDeriving.golden index 1f885211..0301f280 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/EnumDeriving.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/EnumDeriving.golden @@ -36,40 +36,14 @@ Singletons/EnumDeriving.hs:(0,0)-(0,0): Splicing declarations type ToEnum_0123456789876543210 :: GHC.Num.Natural.Natural -> Foo type family ToEnum_0123456789876543210 (a :: GHC.Num.Natural.Natural) :: Foo where ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0)) - type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural Foo - data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural Foo - where - ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) => - ToEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @Foo ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ToEnum_0123456789876543210Sym0KindInference ()) - type ToEnum_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> Foo - type family ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: Foo where - ToEnum_0123456789876543210Sym1 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 type FromEnum_0123456789876543210 :: Foo -> GHC.Num.Natural.Natural type family FromEnum_0123456789876543210 (a :: Foo) :: GHC.Num.Natural.Natural where FromEnum_0123456789876543210 Bar = FromInteger 0 FromEnum_0123456789876543210 Baz = FromInteger 1 FromEnum_0123456789876543210 Bum = FromInteger 2 - type FromEnum_0123456789876543210Sym0 :: (~>) Foo GHC.Num.Natural.Natural - data FromEnum_0123456789876543210Sym0 :: (~>) Foo GHC.Num.Natural.Natural - where - FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) => - FromEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Foo @GHC.Num.Natural.Natural FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) FromEnum_0123456789876543210Sym0KindInference ()) - type FromEnum_0123456789876543210Sym1 :: Foo - -> GHC.Num.Natural.Natural - type family FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: Foo) :: GHC.Num.Natural.Natural where - FromEnum_0123456789876543210Sym1 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 instance PEnum Foo where - type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a - type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a + type ToEnum a = ToEnum_0123456789876543210 a + type FromEnum a = FromEnum_0123456789876543210 a data SFoo :: Foo -> Type where SBar :: SFoo (Bar :: Foo) @@ -152,40 +126,14 @@ Singletons/EnumDeriving.hs:0:0:: Splicing declarations type ToEnum_0123456789876543210 :: GHC.Num.Natural.Natural -> Quux type family ToEnum_0123456789876543210 (a :: GHC.Num.Natural.Natural) :: Quux where ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0)) - type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural Quux - data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural Quux - where - ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) => - ToEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @Quux ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ToEnum_0123456789876543210Sym0KindInference ()) - type ToEnum_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> Quux - type family ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: Quux where - ToEnum_0123456789876543210Sym1 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 type FromEnum_0123456789876543210 :: Quux -> GHC.Num.Natural.Natural type family FromEnum_0123456789876543210 (a :: Quux) :: GHC.Num.Natural.Natural where FromEnum_0123456789876543210 'Q1 = FromInteger 0 FromEnum_0123456789876543210 'Q2 = FromInteger 1 - type FromEnum_0123456789876543210Sym0 :: (~>) Quux GHC.Num.Natural.Natural - data FromEnum_0123456789876543210Sym0 :: (~>) Quux GHC.Num.Natural.Natural - where - FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) => - FromEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Quux @GHC.Num.Natural.Natural FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) FromEnum_0123456789876543210Sym0KindInference ()) - type FromEnum_0123456789876543210Sym1 :: Quux - -> GHC.Num.Natural.Natural - type family FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: Quux) :: GHC.Num.Natural.Natural where - FromEnum_0123456789876543210Sym1 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 instance PEnum Quux where - type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a - type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a + type ToEnum a = ToEnum_0123456789876543210 a + type FromEnum a = FromEnum_0123456789876543210 a instance SEnum Quux where sToEnum (sN :: Sing n) = id diff --git a/singletons-base/tests/compile-and-dump/Singletons/EqInstances.golden b/singletons-base/tests/compile-and-dump/Singletons/EqInstances.golden index 9df5ed9d..fd3b525e 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/EqInstances.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/EqInstances.golden @@ -7,29 +7,8 @@ Singletons/EqInstances.hs:0:0:: Splicing declarations TFHelper_0123456789876543210 'FLeaf ('(:+:) _ _) = FalseSym0 TFHelper_0123456789876543210 ('(:+:) _ _) 'FLeaf = FalseSym0 TFHelper_0123456789876543210 ('(:+:) a_0123456789876543210 a_0123456789876543210) ('(:+:) b_0123456789876543210 b_0123456789876543210) = Apply (Apply (&&@#@$) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210) - type TFHelper_0123456789876543210Sym0 :: (~>) Foo ((~>) Foo Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) Foo ((~>) Foo Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Foo @((~>) Foo Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: Foo -> (~>) Foo Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Foo) :: (~>) Foo Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Foo @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: Foo -> Foo -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Foo) (a0123456789876543210 :: Foo) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq Foo where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a instance SEq Foo => SEq Foo where (%==) SFLeaf SFLeaf = STrue (%==) SFLeaf ((:%+:) _ _) = SFalse @@ -51,28 +30,7 @@ Singletons/EqInstances.hs:0:0:: Splicing declarations type TFHelper_0123456789876543210 :: Empty -> Empty -> Bool type family TFHelper_0123456789876543210 (a :: Empty) (a :: Empty) :: Bool where TFHelper_0123456789876543210 _ _ = TrueSym0 - type TFHelper_0123456789876543210Sym0 :: (~>) Empty ((~>) Empty Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) Empty ((~>) Empty Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Empty @((~>) Empty Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: Empty -> (~>) Empty Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Empty) :: (~>) Empty Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Empty @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: Empty -> Empty -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Empty) (a0123456789876543210 :: Empty) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq Empty where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a instance SEq Empty where (%==) _ _ = STrue diff --git a/singletons-base/tests/compile-and-dump/Singletons/FunDeps.golden b/singletons-base/tests/compile-and-dump/Singletons/FunDeps.golden index cc269a81..9f5cc175 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/FunDeps.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/FunDeps.golden @@ -51,37 +51,13 @@ Singletons/FunDeps.hs:(0,0)-(0,0): Splicing declarations type Meth_0123456789876543210 :: Bool -> Bool type family Meth_0123456789876543210 (a :: Bool) :: Bool where Meth_0123456789876543210 a_0123456789876543210 = Apply NotSym0 a_0123456789876543210 - type Meth_0123456789876543210Sym0 :: (~>) Bool Bool - data Meth_0123456789876543210Sym0 :: (~>) Bool Bool - where - Meth_0123456789876543210Sym0KindInference :: SameKind (Apply Meth_0123456789876543210Sym0 arg) (Meth_0123456789876543210Sym1 arg) => - Meth_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Bool @Bool Meth_0123456789876543210Sym0 a0123456789876543210 = Meth_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings Meth_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Meth_0123456789876543210Sym0KindInference ()) - type Meth_0123456789876543210Sym1 :: Bool -> Bool - type family Meth_0123456789876543210Sym1 (a0123456789876543210 :: Bool) :: Bool where - Meth_0123456789876543210Sym1 a0123456789876543210 = Meth_0123456789876543210 a0123456789876543210 type L2r_0123456789876543210 :: Bool -> Natural type family L2r_0123456789876543210 (a :: Bool) :: Natural where L2r_0123456789876543210 'False = FromInteger 0 L2r_0123456789876543210 'True = FromInteger 1 - type L2r_0123456789876543210Sym0 :: (~>) Bool Natural - data L2r_0123456789876543210Sym0 :: (~>) Bool Natural - where - L2r_0123456789876543210Sym0KindInference :: SameKind (Apply L2r_0123456789876543210Sym0 arg) (L2r_0123456789876543210Sym1 arg) => - L2r_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Bool @Natural L2r_0123456789876543210Sym0 a0123456789876543210 = L2r_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings L2r_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) L2r_0123456789876543210Sym0KindInference ()) - type L2r_0123456789876543210Sym1 :: Bool -> Natural - type family L2r_0123456789876543210Sym1 (a0123456789876543210 :: Bool) :: Natural where - L2r_0123456789876543210Sym1 a0123456789876543210 = L2r_0123456789876543210 a0123456789876543210 instance PFD Bool Natural where - type Meth a = Apply Meth_0123456789876543210Sym0 a - type L2r a = Apply L2r_0123456789876543210Sym0 a + type Meth a = Meth_0123456789876543210 a + type L2r a = L2r_0123456789876543210 a sT1 :: Sing @_ T1Sym0 sT1 = applySing (singFun1 @MethSym0 sMeth) STrue class SFD a b | a -> b where diff --git a/singletons-base/tests/compile-and-dump/Singletons/FunctorLikeDeriving.golden b/singletons-base/tests/compile-and-dump/Singletons/FunctorLikeDeriving.golden index e6039ce7..d0a2ce77 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/FunctorLikeDeriving.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/FunctorLikeDeriving.golden @@ -89,31 +89,6 @@ Singletons/FunctorLikeDeriving.hs:(0,0)-(0,0): Splicing declarations type family Fmap_0123456789876543210 @a @b @x (a :: (~>) a b) (a :: T x a) :: T x b where Fmap_0123456789876543210 @a @b @x (_f_0123456789876543210 :: (~>) a b) (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 :: T x a) = Apply (Apply (Apply (Apply MkT1Sym0 (Apply (Lambda_0123456789876543210Sym0 x _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) a_0123456789876543210)) (Apply _f_0123456789876543210 a_0123456789876543210)) (Apply (Apply FmapSym0 _f_0123456789876543210) a_0123456789876543210)) (Apply (Apply FmapSym0 (Apply FmapSym0 _f_0123456789876543210)) a_0123456789876543210) Fmap_0123456789876543210 @a @b @x (_f_0123456789876543210 :: (~>) a b) (MkT2 a_0123456789876543210 :: T x a) = Apply MkT2Sym0 (Apply (Lambda_0123456789876543210Sym0 x _f_0123456789876543210 a_0123456789876543210) a_0123456789876543210) - type Fmap_0123456789876543210Sym0 :: forall a - b - x. (~>) ((~>) a b) ((~>) (T x a) (T x b)) - data Fmap_0123456789876543210Sym0 :: (~>) ((~>) a b) ((~>) (T x a) (T x b)) - where - Fmap_0123456789876543210Sym0KindInference :: SameKind (Apply Fmap_0123456789876543210Sym0 arg) (Fmap_0123456789876543210Sym1 arg) => - Fmap_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @((~>) a b) @((~>) (T x a) (T x b)) Fmap_0123456789876543210Sym0 a0123456789876543210 = Fmap_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Fmap_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Fmap_0123456789876543210Sym0KindInference ()) - type Fmap_0123456789876543210Sym1 :: forall a b x. (~>) a b - -> (~>) (T x a) (T x b) - data Fmap_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a b) :: (~>) (T x a) (T x b) - where - Fmap_0123456789876543210Sym1KindInference :: SameKind (Apply (Fmap_0123456789876543210Sym1 a0123456789876543210) arg) (Fmap_0123456789876543210Sym2 a0123456789876543210 arg) => - Fmap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(T x a) @(T x b) (Fmap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Fmap_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Fmap_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Fmap_0123456789876543210Sym1KindInference ()) - type Fmap_0123456789876543210Sym2 :: forall a b x. (~>) a b - -> T x a -> T x b - type family Fmap_0123456789876543210Sym2 @a @b @x (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: T x a) :: T x b where - Fmap_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Fmap_0123456789876543210 a0123456789876543210 a0123456789876543210 type family Lambda_0123456789876543210 x0123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_0123456789876543210 where Lambda_0123456789876543210 x _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = n_0123456789876543210 data Lambda_0123456789876543210Sym0 x0123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210 @@ -155,34 +130,9 @@ Singletons/FunctorLikeDeriving.hs:(0,0)-(0,0): Splicing declarations type family TFHelper_0123456789876543210 @a @x @b (a :: a) (a :: T x b) :: T x a where TFHelper_0123456789876543210 @a @x @b (_z_0123456789876543210 :: a) (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 :: T x b) = Apply (Apply (Apply (Apply MkT1Sym0 (Apply (Lambda_0123456789876543210Sym0 x _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) a_0123456789876543210)) (Apply (Lambda_0123456789876543210Sym0 x _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) a_0123456789876543210)) (Apply (Apply (<$@#@$) _z_0123456789876543210) a_0123456789876543210)) (Apply (Apply FmapSym0 (Apply (<$@#@$) _z_0123456789876543210)) a_0123456789876543210) TFHelper_0123456789876543210 @a @x @b (_z_0123456789876543210 :: a) (MkT2 a_0123456789876543210 :: T x b) = Apply MkT2Sym0 (Apply (Lambda_0123456789876543210Sym0 x _z_0123456789876543210 a_0123456789876543210) a_0123456789876543210) - type TFHelper_0123456789876543210Sym0 :: forall a - x - b. (~>) a ((~>) (T x b) (T x a)) - data TFHelper_0123456789876543210Sym0 :: (~>) a ((~>) (T x b) (T x a)) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @a @((~>) (T x b) (T x a)) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: forall a x b. a - -> (~>) (T x b) (T x a) - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: a) :: (~>) (T x b) (T x a) - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(T x b) @(T x a) (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: forall a x b. a - -> T x b -> T x a - type family TFHelper_0123456789876543210Sym2 @a @x @b (a0123456789876543210 :: a) (a0123456789876543210 :: T x b) :: T x a where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PFunctor (T x) where - type Fmap a a = Apply (Apply Fmap_0123456789876543210Sym0 a) a - type (<$) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type Fmap a a = Fmap_0123456789876543210 a a + type (<$) a a = TFHelper_0123456789876543210 a a type family Lambda_0123456789876543210 x0123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_0123456789876543210 where Lambda_0123456789876543210 x _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = MemptySym0 data Lambda_0123456789876543210Sym0 x0123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210 @@ -212,31 +162,6 @@ Singletons/FunctorLikeDeriving.hs:(0,0)-(0,0): Splicing declarations type family FoldMap_0123456789876543210 @a @m @x (a :: (~>) a m) (a :: T x a) :: m where FoldMap_0123456789876543210 @a @m @x (_f_0123456789876543210 :: (~>) a m) (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 :: T x a) = Apply (Apply MappendSym0 (Apply (Lambda_0123456789876543210Sym0 x _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) a_0123456789876543210)) (Apply (Apply MappendSym0 (Apply _f_0123456789876543210 a_0123456789876543210)) (Apply (Apply MappendSym0 (Apply (Apply FoldMapSym0 _f_0123456789876543210) a_0123456789876543210)) (Apply (Apply FoldMapSym0 (Apply FoldMapSym0 _f_0123456789876543210)) a_0123456789876543210))) FoldMap_0123456789876543210 @a @m @x (_f_0123456789876543210 :: (~>) a m) (MkT2 a_0123456789876543210 :: T x a) = Apply (Lambda_0123456789876543210Sym0 x _f_0123456789876543210 a_0123456789876543210) a_0123456789876543210 - type FoldMap_0123456789876543210Sym0 :: forall a - m - x. (~>) ((~>) a m) ((~>) (T x a) m) - data FoldMap_0123456789876543210Sym0 :: (~>) ((~>) a m) ((~>) (T x a) m) - where - FoldMap_0123456789876543210Sym0KindInference :: SameKind (Apply FoldMap_0123456789876543210Sym0 arg) (FoldMap_0123456789876543210Sym1 arg) => - FoldMap_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @((~>) a m) @((~>) (T x a) m) FoldMap_0123456789876543210Sym0 a0123456789876543210 = FoldMap_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings FoldMap_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) FoldMap_0123456789876543210Sym0KindInference ()) - type FoldMap_0123456789876543210Sym1 :: forall a m x. (~>) a m - -> (~>) (T x a) m - data FoldMap_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a m) :: (~>) (T x a) m - where - FoldMap_0123456789876543210Sym1KindInference :: SameKind (Apply (FoldMap_0123456789876543210Sym1 a0123456789876543210) arg) (FoldMap_0123456789876543210Sym2 a0123456789876543210 arg) => - FoldMap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(T x a) @m (FoldMap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FoldMap_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (FoldMap_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) FoldMap_0123456789876543210Sym1KindInference ()) - type FoldMap_0123456789876543210Sym2 :: forall a m x. (~>) a m - -> T x a -> m - type family FoldMap_0123456789876543210Sym2 @a @m @x (a0123456789876543210 :: (~>) a m) (a0123456789876543210 :: T x a) :: m where - FoldMap_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = FoldMap_0123456789876543210 a0123456789876543210 a0123456789876543210 type family Lambda_0123456789876543210 x0123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_0123456789876543210 n2_0123456789876543210 where Lambda_0123456789876543210 x _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = n2_0123456789876543210 data Lambda_0123456789876543210Sym0 x0123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 @@ -342,207 +267,42 @@ Singletons/FunctorLikeDeriving.hs:(0,0)-(0,0): Splicing declarations type family Foldr_0123456789876543210 @a @b @x (a :: (~>) a ((~>) b b)) (a :: b) (a :: T x a) :: b where Foldr_0123456789876543210 @a @b @x (_f_0123456789876543210 :: (~>) a ((~>) b b)) (_z_0123456789876543210 :: b) (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 :: T x a) = Apply (Apply (Lambda_0123456789876543210Sym0 x _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) a_0123456789876543210) (Apply (Apply _f_0123456789876543210 a_0123456789876543210) (Apply (Apply (Lambda_0123456789876543210Sym0 x _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) a_0123456789876543210) (Apply (Apply (Lambda_0123456789876543210Sym0 x _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) a_0123456789876543210) _z_0123456789876543210))) Foldr_0123456789876543210 @a @b @x (_f_0123456789876543210 :: (~>) a ((~>) b b)) (_z_0123456789876543210 :: b) (MkT2 a_0123456789876543210 :: T x a) = Apply (Apply (Lambda_0123456789876543210Sym0 x _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210) a_0123456789876543210) _z_0123456789876543210 - type Foldr_0123456789876543210Sym0 :: forall a - b - x. (~>) ((~>) a ((~>) b b)) ((~>) b ((~>) (T x a) b)) - data Foldr_0123456789876543210Sym0 :: (~>) ((~>) a ((~>) b b)) ((~>) b ((~>) (T x a) b)) - where - Foldr_0123456789876543210Sym0KindInference :: SameKind (Apply Foldr_0123456789876543210Sym0 arg) (Foldr_0123456789876543210Sym1 arg) => - Foldr_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @((~>) a ((~>) b b)) @((~>) b ((~>) (T x a) b)) Foldr_0123456789876543210Sym0 a0123456789876543210 = Foldr_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Foldr_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Foldr_0123456789876543210Sym0KindInference ()) - type Foldr_0123456789876543210Sym1 :: forall a - b - x. (~>) a ((~>) b b) -> (~>) b ((~>) (T x a) b) - data Foldr_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a ((~>) b b)) :: (~>) b ((~>) (T x a) b) - where - Foldr_0123456789876543210Sym1KindInference :: SameKind (Apply (Foldr_0123456789876543210Sym1 a0123456789876543210) arg) (Foldr_0123456789876543210Sym2 a0123456789876543210 arg) => - Foldr_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @b @((~>) (T x a) b) (Foldr_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Foldr_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Foldr_0123456789876543210Sym1KindInference ()) - type Foldr_0123456789876543210Sym2 :: forall a - b - x. (~>) a ((~>) b b) -> b -> (~>) (T x a) b - data Foldr_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a ((~>) b b)) (a0123456789876543210 :: b) :: (~>) (T x a) b - where - Foldr_0123456789876543210Sym2KindInference :: SameKind (Apply (Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (Foldr_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @(T x a) @b (Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = Foldr_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Foldr_0123456789876543210Sym2KindInference ()) - type Foldr_0123456789876543210Sym3 :: forall a - b - x. (~>) a ((~>) b b) -> b -> T x a -> b - type family Foldr_0123456789876543210Sym3 @a @b @x (a0123456789876543210 :: (~>) a ((~>) b b)) (a0123456789876543210 :: b) (a0123456789876543210 :: T x a) :: b where - Foldr_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = Foldr_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PFoldable (T x) where - type FoldMap a a = Apply (Apply FoldMap_0123456789876543210Sym0 a) a - type Foldr a a a = Apply (Apply (Apply Foldr_0123456789876543210Sym0 a) a) a + type FoldMap a a = FoldMap_0123456789876543210 a a + type Foldr a a a = Foldr_0123456789876543210 a a a type Traverse_0123456789876543210 :: forall a f b x. (~>) a (f b) -> T x a -> f (T x b) type family Traverse_0123456789876543210 @a @f @b @x (a :: (~>) a (f b)) (a :: T x a) :: f (T x b) where Traverse_0123456789876543210 @a @f @b @x (_f_0123456789876543210 :: (~>) a (f b)) (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 :: T x a) = Apply (Apply (<*>@#@$) (Apply (Apply (<*>@#@$) (Apply (Apply (Apply LiftA2Sym0 MkT1Sym0) (Apply PureSym0 a_0123456789876543210)) (Apply _f_0123456789876543210 a_0123456789876543210))) (Apply (Apply TraverseSym0 _f_0123456789876543210) a_0123456789876543210))) (Apply (Apply TraverseSym0 (Apply TraverseSym0 _f_0123456789876543210)) a_0123456789876543210) Traverse_0123456789876543210 @a @f @b @x (_f_0123456789876543210 :: (~>) a (f b)) (MkT2 a_0123456789876543210 :: T x a) = Apply (Apply FmapSym0 MkT2Sym0) (Apply PureSym0 a_0123456789876543210) - type Traverse_0123456789876543210Sym0 :: forall a - f - b - x. (~>) ((~>) a (f b)) ((~>) (T x a) (f (T x b))) - data Traverse_0123456789876543210Sym0 :: (~>) ((~>) a (f b)) ((~>) (T x a) (f (T x b))) - where - Traverse_0123456789876543210Sym0KindInference :: SameKind (Apply Traverse_0123456789876543210Sym0 arg) (Traverse_0123456789876543210Sym1 arg) => - Traverse_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @((~>) a (f b)) @((~>) (T x a) (f (T x b))) Traverse_0123456789876543210Sym0 a0123456789876543210 = Traverse_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Traverse_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Traverse_0123456789876543210Sym0KindInference ()) - type Traverse_0123456789876543210Sym1 :: forall a - f - b - x. (~>) a (f b) -> (~>) (T x a) (f (T x b)) - data Traverse_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a (f b)) :: (~>) (T x a) (f (T x b)) - where - Traverse_0123456789876543210Sym1KindInference :: SameKind (Apply (Traverse_0123456789876543210Sym1 a0123456789876543210) arg) (Traverse_0123456789876543210Sym2 a0123456789876543210 arg) => - Traverse_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(T x a) @(f (T x b)) (Traverse_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Traverse_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Traverse_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Traverse_0123456789876543210Sym1KindInference ()) - type Traverse_0123456789876543210Sym2 :: forall a - f - b - x. (~>) a (f b) -> T x a -> f (T x b) - type family Traverse_0123456789876543210Sym2 @a @f @b @x (a0123456789876543210 :: (~>) a (f b)) (a0123456789876543210 :: T x a) :: f (T x b) where - Traverse_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Traverse_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PTraversable (T x) where - type Traverse a a = Apply (Apply Traverse_0123456789876543210Sym0 a) a + type Traverse a a = Traverse_0123456789876543210 a a type family Case_0123456789876543210 v_01234567898765432100123456789876543210 t where type Fmap_0123456789876543210 :: forall a b. (~>) a b -> Empty a -> Empty b type family Fmap_0123456789876543210 @a @b (a :: (~>) a b) (a :: Empty a) :: Empty b where Fmap_0123456789876543210 @a @b _ v_0123456789876543210 = Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210 - type Fmap_0123456789876543210Sym0 :: forall a - b. (~>) ((~>) a b) ((~>) (Empty a) (Empty b)) - data Fmap_0123456789876543210Sym0 :: (~>) ((~>) a b) ((~>) (Empty a) (Empty b)) - where - Fmap_0123456789876543210Sym0KindInference :: SameKind (Apply Fmap_0123456789876543210Sym0 arg) (Fmap_0123456789876543210Sym1 arg) => - Fmap_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @((~>) a b) @((~>) (Empty a) (Empty b)) Fmap_0123456789876543210Sym0 a0123456789876543210 = Fmap_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Fmap_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Fmap_0123456789876543210Sym0KindInference ()) - type Fmap_0123456789876543210Sym1 :: forall a b. (~>) a b - -> (~>) (Empty a) (Empty b) - data Fmap_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a b) :: (~>) (Empty a) (Empty b) - where - Fmap_0123456789876543210Sym1KindInference :: SameKind (Apply (Fmap_0123456789876543210Sym1 a0123456789876543210) arg) (Fmap_0123456789876543210Sym2 a0123456789876543210 arg) => - Fmap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Empty a) @(Empty b) (Fmap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Fmap_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Fmap_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Fmap_0123456789876543210Sym1KindInference ()) - type Fmap_0123456789876543210Sym2 :: forall a b. (~>) a b - -> Empty a -> Empty b - type family Fmap_0123456789876543210Sym2 @a @b (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: Empty a) :: Empty b where - Fmap_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Fmap_0123456789876543210 a0123456789876543210 a0123456789876543210 type family Case_0123456789876543210 v_01234567898765432100123456789876543210 t where type TFHelper_0123456789876543210 :: forall a b. a -> Empty b -> Empty a type family TFHelper_0123456789876543210 @a @b (a :: a) (a :: Empty b) :: Empty a where TFHelper_0123456789876543210 @a @b _ v_0123456789876543210 = Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210 - type TFHelper_0123456789876543210Sym0 :: forall a - b. (~>) a ((~>) (Empty b) (Empty a)) - data TFHelper_0123456789876543210Sym0 :: (~>) a ((~>) (Empty b) (Empty a)) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @a @((~>) (Empty b) (Empty a)) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: forall a b. a - -> (~>) (Empty b) (Empty a) - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: a) :: (~>) (Empty b) (Empty a) - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Empty b) @(Empty a) (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: forall a b. a - -> Empty b -> Empty a - type family TFHelper_0123456789876543210Sym2 @a @b (a0123456789876543210 :: a) (a0123456789876543210 :: Empty b) :: Empty a where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PFunctor Empty where - type Fmap a a = Apply (Apply Fmap_0123456789876543210Sym0 a) a - type (<$) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type Fmap a a = Fmap_0123456789876543210 a a + type (<$) a a = TFHelper_0123456789876543210 a a type FoldMap_0123456789876543210 :: forall a m. (~>) a m -> Empty a -> m type family FoldMap_0123456789876543210 @a @m (a :: (~>) a m) (a :: Empty a) :: m where FoldMap_0123456789876543210 @a @m _ _ = MemptySym0 - type FoldMap_0123456789876543210Sym0 :: forall a - m. (~>) ((~>) a m) ((~>) (Empty a) m) - data FoldMap_0123456789876543210Sym0 :: (~>) ((~>) a m) ((~>) (Empty a) m) - where - FoldMap_0123456789876543210Sym0KindInference :: SameKind (Apply FoldMap_0123456789876543210Sym0 arg) (FoldMap_0123456789876543210Sym1 arg) => - FoldMap_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @((~>) a m) @((~>) (Empty a) m) FoldMap_0123456789876543210Sym0 a0123456789876543210 = FoldMap_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings FoldMap_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) FoldMap_0123456789876543210Sym0KindInference ()) - type FoldMap_0123456789876543210Sym1 :: forall a m. (~>) a m - -> (~>) (Empty a) m - data FoldMap_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a m) :: (~>) (Empty a) m - where - FoldMap_0123456789876543210Sym1KindInference :: SameKind (Apply (FoldMap_0123456789876543210Sym1 a0123456789876543210) arg) (FoldMap_0123456789876543210Sym2 a0123456789876543210 arg) => - FoldMap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Empty a) @m (FoldMap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FoldMap_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (FoldMap_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) FoldMap_0123456789876543210Sym1KindInference ()) - type FoldMap_0123456789876543210Sym2 :: forall a m. (~>) a m - -> Empty a -> m - type family FoldMap_0123456789876543210Sym2 @a @m (a0123456789876543210 :: (~>) a m) (a0123456789876543210 :: Empty a) :: m where - FoldMap_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = FoldMap_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PFoldable Empty where - type FoldMap a a = Apply (Apply FoldMap_0123456789876543210Sym0 a) a + type FoldMap a a = FoldMap_0123456789876543210 a a type family Case_0123456789876543210 v_01234567898765432100123456789876543210 t where type Traverse_0123456789876543210 :: forall a f b. (~>) a (f b) -> Empty a -> f (Empty b) type family Traverse_0123456789876543210 @a @f @b (a :: (~>) a (f b)) (a :: Empty a) :: f (Empty b) where Traverse_0123456789876543210 @a @f @b _ v_0123456789876543210 = Apply PureSym0 (Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210) - type Traverse_0123456789876543210Sym0 :: forall a - f - b. (~>) ((~>) a (f b)) ((~>) (Empty a) (f (Empty b))) - data Traverse_0123456789876543210Sym0 :: (~>) ((~>) a (f b)) ((~>) (Empty a) (f (Empty b))) - where - Traverse_0123456789876543210Sym0KindInference :: SameKind (Apply Traverse_0123456789876543210Sym0 arg) (Traverse_0123456789876543210Sym1 arg) => - Traverse_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @((~>) a (f b)) @((~>) (Empty a) (f (Empty b))) Traverse_0123456789876543210Sym0 a0123456789876543210 = Traverse_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Traverse_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Traverse_0123456789876543210Sym0KindInference ()) - type Traverse_0123456789876543210Sym1 :: forall a f b. (~>) a (f b) - -> (~>) (Empty a) (f (Empty b)) - data Traverse_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a (f b)) :: (~>) (Empty a) (f (Empty b)) - where - Traverse_0123456789876543210Sym1KindInference :: SameKind (Apply (Traverse_0123456789876543210Sym1 a0123456789876543210) arg) (Traverse_0123456789876543210Sym2 a0123456789876543210 arg) => - Traverse_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Empty a) @(f (Empty b)) (Traverse_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Traverse_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Traverse_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Traverse_0123456789876543210Sym1KindInference ()) - type Traverse_0123456789876543210Sym2 :: forall a f b. (~>) a (f b) - -> Empty a -> f (Empty b) - type family Traverse_0123456789876543210Sym2 @a @f @b (a0123456789876543210 :: (~>) a (f b)) (a0123456789876543210 :: Empty a) :: f (Empty b) where - Traverse_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Traverse_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PTraversable Empty where - type Traverse a a = Apply (Apply Traverse_0123456789876543210Sym0 a) a + type Traverse a a = Traverse_0123456789876543210 a a data ST :: forall x a. T x a -> Type where SMkT1 :: forall x diff --git a/singletons-base/tests/compile-and-dump/Singletons/Maybe.golden b/singletons-base/tests/compile-and-dump/Singletons/Maybe.golden index 823cca14..2dd9263e 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/Maybe.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/Maybe.golden @@ -28,74 +28,16 @@ Singletons/Maybe.hs:(0,0)-(0,0): Splicing declarations TFHelper_0123456789876543210 @a (Nothing :: Maybe a) (Just _ :: Maybe a) = FalseSym0 TFHelper_0123456789876543210 @a (Just _ :: Maybe a) (Nothing :: Maybe a) = FalseSym0 TFHelper_0123456789876543210 @a (Just a_0123456789876543210 :: Maybe a) (Just b_0123456789876543210 :: Maybe a) = Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210 - type TFHelper_0123456789876543210Sym0 :: forall a. (~>) (Maybe a) ((~>) (Maybe a) Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) (Maybe a) ((~>) (Maybe a) Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @(Maybe a) @((~>) (Maybe a) Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: forall a. Maybe a - -> (~>) (Maybe a) Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Maybe a) :: (~>) (Maybe a) Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Maybe a) @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: forall a. Maybe a - -> Maybe a -> Bool - type family TFHelper_0123456789876543210Sym2 @a (a0123456789876543210 :: Maybe a) (a0123456789876543210 :: Maybe a) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq (Maybe a) where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type ShowsPrec_0123456789876543210 :: forall a. GHC.Num.Natural.Natural -> Maybe a -> GHC.Types.Symbol -> GHC.Types.Symbol type family ShowsPrec_0123456789876543210 @a (a :: GHC.Num.Natural.Natural) (a :: Maybe a) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where ShowsPrec_0123456789876543210 @a (_ :: GHC.Num.Natural.Natural) (Nothing :: Maybe a) (a_0123456789876543210 :: GHC.Types.Symbol) = Apply (Apply ShowStringSym0 "Nothing") a_0123456789876543210 ShowsPrec_0123456789876543210 @a (p_0123456789876543210 :: GHC.Num.Natural.Natural) (Just arg_0123456789876543210 :: Maybe a) (a_0123456789876543210 :: GHC.Types.Symbol) = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Just ")) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: forall a. (~>) GHC.Num.Natural.Natural ((~>) (Maybe a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) (Maybe a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) (Maybe a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: forall a. GHC.Num.Natural.Natural - -> (~>) (Maybe a) ((~>) GHC.Types.Symbol GHC.Types.Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) (Maybe a) ((~>) 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 @(Maybe a) @((~>) GHC.Types.Symbol GHC.Types.Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: forall a. GHC.Num.Natural.Natural - -> Maybe a - -> (~>) GHC.Types.Symbol GHC.Types.Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Maybe a) :: (~>) 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 @GHC.Types.Symbol @GHC.Types.Symbol (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym2KindInference ()) - type ShowsPrec_0123456789876543210Sym3 :: forall a. GHC.Num.Natural.Natural - -> Maybe a - -> GHC.Types.Symbol -> GHC.Types.Symbol - type family ShowsPrec_0123456789876543210Sym3 @a (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Maybe a) (a0123456789876543210 :: GHC.Types.Symbol) :: GHC.Types.Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow (Maybe a) where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a data SMaybe :: forall a. Maybe a -> Type where SNothing :: forall a. SMaybe (Nothing :: Maybe a) diff --git a/singletons-base/tests/compile-and-dump/Singletons/Nat.golden b/singletons-base/tests/compile-and-dump/Singletons/Nat.golden index dd1eb806..8a61fa07 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/Nat.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/Nat.golden @@ -82,98 +82,23 @@ Singletons/Nat.hs:(0,0)-(0,0): Splicing declarations TFHelper_0123456789876543210 Zero (Succ _) = FalseSym0 TFHelper_0123456789876543210 (Succ _) Zero = FalseSym0 TFHelper_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210 - type TFHelper_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Nat @((~>) Nat Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: Nat -> (~>) Nat Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Nat @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: Nat -> Nat -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq Nat where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type ShowsPrec_0123456789876543210 :: GHC.Num.Natural.Natural -> Nat -> GHC.Types.Symbol -> GHC.Types.Symbol type family ShowsPrec_0123456789876543210 (a :: GHC.Num.Natural.Natural) (a :: Nat) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where ShowsPrec_0123456789876543210 _ Zero a_0123456789876543210 = Apply (Apply ShowStringSym0 "Zero") a_0123456789876543210 ShowsPrec_0123456789876543210 p_0123456789876543210 (Succ arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Succ ")) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) Nat ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) Nat ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) Nat ((~>) GHC.Types.Symbol GHC.Types.Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> (~>) Nat ((~>) GHC.Types.Symbol GHC.Types.Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) Nat ((~>) 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 @Nat @((~>) GHC.Types.Symbol GHC.Types.Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: GHC.Num.Natural.Natural - -> Nat -> (~>) GHC.Types.Symbol GHC.Types.Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Nat) :: (~>) 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 @GHC.Types.Symbol @GHC.Types.Symbol (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.Num.Natural.Natural - -> Nat -> GHC.Types.Symbol -> GHC.Types.Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Nat) (a0123456789876543210 :: GHC.Types.Symbol) :: GHC.Types.Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow Nat where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a type Compare_0123456789876543210 :: Nat -> Nat -> Ordering type family Compare_0123456789876543210 (a :: Nat) (a :: Nat) :: Ordering where Compare_0123456789876543210 Zero Zero = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) NilSym0 Compare_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0) Compare_0123456789876543210 Zero (Succ _) = LTSym0 Compare_0123456789876543210 (Succ _) Zero = GTSym0 - type Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering) - data Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Nat @((~>) Nat Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: Nat -> (~>) Nat Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Nat @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: Nat -> Nat -> Ordering - type family Compare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd Nat where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a sPred :: (forall (t :: Nat). Sing t -> Sing (Apply PredSym0 t :: Nat) :: Type) diff --git a/singletons-base/tests/compile-and-dump/Singletons/OrdDeriving.golden b/singletons-base/tests/compile-and-dump/Singletons/OrdDeriving.golden index de075b3e..ea2826c5 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/OrdDeriving.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/OrdDeriving.golden @@ -283,58 +283,16 @@ Singletons/OrdDeriving.hs:(0,0)-(0,0): Splicing declarations TFHelper_0123456789876543210 Zero (Succ _) = FalseSym0 TFHelper_0123456789876543210 (Succ _) Zero = FalseSym0 TFHelper_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210 - type TFHelper_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Nat @((~>) Nat Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: Nat -> (~>) Nat Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Nat @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: Nat -> Nat -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq Nat where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: Nat -> Nat -> Ordering type family Compare_0123456789876543210 (a :: Nat) (a :: Nat) :: Ordering where Compare_0123456789876543210 Zero Zero = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) NilSym0 Compare_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0) Compare_0123456789876543210 Zero (Succ _) = LTSym0 Compare_0123456789876543210 (Succ _) Zero = GTSym0 - type Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering) - data Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Nat @((~>) Nat Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: Nat -> (~>) Nat Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Nat @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: Nat -> Nat -> Ordering - type family Compare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd Nat where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a type TFHelper_0123456789876543210 :: forall a b c d. Foo a b c d -> Foo a b c d -> Bool type family TFHelper_0123456789876543210 @a @b @c @d (a :: Foo a b c d) (a :: Foo a b c d) :: Bool where @@ -374,38 +332,8 @@ Singletons/OrdDeriving.hs:(0,0)-(0,0): Splicing declarations TFHelper_0123456789876543210 @a @b @c @d (F _ _ _ _ :: Foo a b c d) (D _ _ _ _ :: Foo a b c d) = FalseSym0 TFHelper_0123456789876543210 @a @b @c @d (F _ _ _ _ :: Foo a b c d) (E _ _ _ _ :: Foo a b c d) = FalseSym0 TFHelper_0123456789876543210 @a @b @c @d (F a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 :: Foo a b c d) (F b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 :: Foo a b c d) = Apply (Apply (&&@#@$) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (&&@#@$) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (&&@#@$) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210))) - type TFHelper_0123456789876543210Sym0 :: forall a - b - c - d. (~>) (Foo a b c d) ((~>) (Foo a b c d) Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) (Foo a b c d) ((~>) (Foo a b c d) Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @(Foo a b c d) @((~>) (Foo a b c d) Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: forall a - b - c - d. Foo a b c d -> (~>) (Foo a b c d) Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Foo a b c d) :: (~>) (Foo a b c d) Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Foo a b c d) @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: forall a - b - c - d. Foo a b c d -> Foo a b c d -> Bool - type family TFHelper_0123456789876543210Sym2 @a @b @c @d (a0123456789876543210 :: Foo a b c d) (a0123456789876543210 :: Foo a b c d) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq (Foo a b c d) where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: forall a b c d. Foo a b c d -> Foo a b c d -> Ordering type family Compare_0123456789876543210 @a @b @c @d (a :: Foo a b c d) (a :: Foo a b c d) :: Ordering where @@ -445,34 +373,8 @@ Singletons/OrdDeriving.hs:(0,0)-(0,0): Splicing declarations Compare_0123456789876543210 @a @b @c @d (F _ _ _ _ :: Foo a b c d) (C _ _ _ _ :: Foo a b c d) = GTSym0 Compare_0123456789876543210 @a @b @c @d (F _ _ _ _ :: Foo a b c d) (D _ _ _ _ :: Foo a b c d) = GTSym0 Compare_0123456789876543210 @a @b @c @d (F _ _ _ _ :: Foo a b c d) (E _ _ _ _ :: Foo a b c d) = GTSym0 - type Compare_0123456789876543210Sym0 :: forall a - b - c - d. (~>) (Foo a b c d) ((~>) (Foo a b c d) Ordering) - data Compare_0123456789876543210Sym0 :: (~>) (Foo a b c d) ((~>) (Foo a b c d) Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @(Foo a b c d) @((~>) (Foo a b c d) Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: forall a b c d. Foo a b c d - -> (~>) (Foo a b c d) Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Foo a b c d) :: (~>) (Foo a b c d) Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Foo a b c d) @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: forall a b c d. Foo a b c d - -> Foo a b c d -> Ordering - type family Compare_0123456789876543210Sym2 @a @b @c @d (a0123456789876543210 :: Foo a b c d) (a0123456789876543210 :: Foo a b c d) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd (Foo a b c d) where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a data SNat :: Nat -> Type where SZero :: SNat (Zero :: Nat) diff --git a/singletons-base/tests/compile-and-dump/Singletons/PatternMatching.golden b/singletons-base/tests/compile-and-dump/Singletons/PatternMatching.golden index 5f8ccc46..983e33d9 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/PatternMatching.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/PatternMatching.golden @@ -56,45 +56,8 @@ Singletons/PatternMatching.hs:(0,0)-(0,0): Splicing declarations -> Pair a b -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 @a @b (a :: GHC.Num.Natural.Natural) (a :: Pair a b) (a :: Symbol) :: Symbol where ShowsPrec_0123456789876543210 @a @b (p_0123456789876543210 :: GHC.Num.Natural.Natural) (Pair arg_0123456789876543210 arg_0123456789876543210 :: Pair a b) (a_0123456789876543210 :: Symbol) = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Pair ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: forall a - b. (~>) GHC.Num.Natural.Natural ((~>) (Pair a b) ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) (Pair a b) ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) (Pair a b) ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: forall a - b. GHC.Num.Natural.Natural - -> (~>) (Pair a b) ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) (Pair a b) ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Pair a b) @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: forall a - b. GHC.Num.Natural.Natural - -> Pair a b -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Pair a b) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym2KindInference ()) - type ShowsPrec_0123456789876543210Sym3 :: forall a - b. GHC.Num.Natural.Natural - -> Pair a b -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 @a @b (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Pair a b) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow (Pair a b) where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a sAList :: Sing @_ AListSym0 sTuple :: Sing @_ TupleSym0 sComplex :: Sing @_ ComplexSym0 diff --git a/singletons-base/tests/compile-and-dump/Singletons/ShowDeriving.golden b/singletons-base/tests/compile-and-dump/Singletons/ShowDeriving.golden index df7a23c9..6b296716 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/ShowDeriving.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/ShowDeriving.golden @@ -163,41 +163,8 @@ Singletons/ShowDeriving.hs:(0,0)-(0,0): Splicing declarations -> Foo1 -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 (a :: GHC.Num.Natural.Natural) (a :: Foo1) (a :: Symbol) :: Symbol where ShowsPrec_0123456789876543210 _ MkFoo1 a_0123456789876543210 = Apply (Apply ShowStringSym0 "MkFoo1") a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) Foo1 ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) Foo1 ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) Foo1 ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> (~>) Foo1 ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) Foo1 ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Foo1 @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: GHC.Num.Natural.Natural - -> Foo1 -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Foo1) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (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.Num.Natural.Natural - -> Foo1 -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Foo1) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow Foo1 where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a type ShowsPrec_0123456789876543210 :: forall a. GHC.Num.Natural.Natural -> Foo2 a -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 @a (a :: GHC.Num.Natural.Natural) (a :: Foo2 a) (a :: Symbol) :: Symbol where @@ -205,80 +172,14 @@ Singletons/ShowDeriving.hs:(0,0)-(0,0): Splicing declarations ShowsPrec_0123456789876543210 @a (p_0123456789876543210 :: GHC.Num.Natural.Natural) (MkFoo2b argL_0123456789876543210 argR_0123456789876543210 :: Foo2 a) (a_0123456789876543210 :: Symbol) = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 5))) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argL_0123456789876543210)) (Apply (Apply (.@#@$) (Apply ShowStringSym0 " `MkFoo2b` ")) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argR_0123456789876543210)))) a_0123456789876543210 ShowsPrec_0123456789876543210 @a (p_0123456789876543210 :: GHC.Num.Natural.Natural) ((:*:) arg_0123456789876543210 arg_0123456789876543210 :: Foo2 a) (a_0123456789876543210 :: Symbol) = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "(:*:) ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210 ShowsPrec_0123456789876543210 @a (p_0123456789876543210 :: GHC.Num.Natural.Natural) ((:&:) argL_0123456789876543210 argR_0123456789876543210 :: Foo2 a) (a_0123456789876543210 :: Symbol) = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 5))) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argL_0123456789876543210)) (Apply (Apply (.@#@$) (Apply ShowStringSym0 " :&: ")) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argR_0123456789876543210)))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: forall a. (~>) GHC.Num.Natural.Natural ((~>) (Foo2 a) ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) (Foo2 a) ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) (Foo2 a) ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: forall a. GHC.Num.Natural.Natural - -> (~>) (Foo2 a) ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) (Foo2 a) ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Foo2 a) @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: forall a. GHC.Num.Natural.Natural - -> Foo2 a -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Foo2 a) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym2KindInference ()) - type ShowsPrec_0123456789876543210Sym3 :: forall a. GHC.Num.Natural.Natural - -> Foo2 a -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 @a (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Foo2 a) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow (Foo2 a) where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a type ShowsPrec_0123456789876543210 :: GHC.Num.Natural.Natural -> Foo3 -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 (a :: GHC.Num.Natural.Natural) (a :: Foo3) (a :: Symbol) :: Symbol where ShowsPrec_0123456789876543210 p_0123456789876543210 (MkFoo3 arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "MkFoo3 ")) (Apply (Apply (.@#@$) (Apply ShowCharSym0 '{')) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "getFoo3a = ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 0)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowCommaSpaceSym0) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "(***) = ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 0)) arg_0123456789876543210)) (Apply ShowCharSym0 '}'))))))))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) Foo3 ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) Foo3 ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) Foo3 ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> (~>) Foo3 ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) Foo3 ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Foo3 @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: GHC.Num.Natural.Natural - -> Foo3 -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Foo3) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (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.Num.Natural.Natural - -> Foo3 -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Foo3) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow Foo3 where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a infixl 5 :%&: infixl 5 :%*: infixl 5 `SMkFoo2b` diff --git a/singletons-base/tests/compile-and-dump/Singletons/StandaloneDeriving.golden b/singletons-base/tests/compile-and-dump/Singletons/StandaloneDeriving.golden index 127e4c84..fd62e9f6 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/StandaloneDeriving.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/StandaloneDeriving.golden @@ -57,212 +57,52 @@ Singletons/StandaloneDeriving.hs:(0,0)-(0,0): Splicing declarations -> T a () -> Bool type family TFHelper_0123456789876543210 @a (a :: T a ()) (a :: T a ()) :: Bool where TFHelper_0123456789876543210 @a ((:*:) a_0123456789876543210 a_0123456789876543210 :: T a ()) ((:*:) b_0123456789876543210 b_0123456789876543210 :: T a ()) = Apply (Apply (&&@#@$) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210) - type TFHelper_0123456789876543210Sym0 :: forall a. (~>) (T a ()) ((~>) (T a ()) Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) (T a ()) ((~>) (T a ()) Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @(T a ()) @((~>) (T a ()) Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: forall a. T a () - -> (~>) (T a ()) Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: T a ()) :: (~>) (T a ()) Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(T a ()) @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: forall a. T a () - -> T a () -> Bool - type family TFHelper_0123456789876543210Sym2 @a (a0123456789876543210 :: T a ()) (a0123456789876543210 :: T a ()) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq (T a ()) where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: forall a. T a () -> T a () -> Ordering type family Compare_0123456789876543210 @a (a :: T a ()) (a :: T a ()) :: Ordering where Compare_0123456789876543210 @a ((:*:) a_0123456789876543210 a_0123456789876543210 :: T a ()) ((:*:) b_0123456789876543210 b_0123456789876543210 :: T a ()) = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0)) - type Compare_0123456789876543210Sym0 :: forall a. (~>) (T a ()) ((~>) (T a ()) Ordering) - data Compare_0123456789876543210Sym0 :: (~>) (T a ()) ((~>) (T a ()) Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @(T a ()) @((~>) (T a ()) Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: forall a. T a () - -> (~>) (T a ()) Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: T a ()) :: (~>) (T a ()) Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(T a ()) @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: forall a. T a () - -> T a () -> Ordering - type family Compare_0123456789876543210Sym2 @a (a0123456789876543210 :: T a ()) (a0123456789876543210 :: T a ()) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd (T a ()) where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a type ShowsPrec_0123456789876543210 :: forall a. GHC.Num.Natural.Natural -> T a () -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 @a (a :: GHC.Num.Natural.Natural) (a :: T a ()) (a :: Symbol) :: Symbol where ShowsPrec_0123456789876543210 @a (p_0123456789876543210 :: GHC.Num.Natural.Natural) ((:*:) argL_0123456789876543210 argR_0123456789876543210 :: T a ()) (a_0123456789876543210 :: Symbol) = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 6))) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 7)) argL_0123456789876543210)) (Apply (Apply (.@#@$) (Apply ShowStringSym0 " :*: ")) (Apply (Apply ShowsPrecSym0 (FromInteger 7)) argR_0123456789876543210)))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: forall a. (~>) GHC.Num.Natural.Natural ((~>) (T a ()) ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) (T a ()) ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) (T a ()) ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: forall a. GHC.Num.Natural.Natural - -> (~>) (T a ()) ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) (T a ()) ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(T a ()) @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: forall a. GHC.Num.Natural.Natural - -> T a () -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: T a ()) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym2KindInference ()) - type ShowsPrec_0123456789876543210Sym3 :: forall a. GHC.Num.Natural.Natural - -> T a () -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 @a (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: T a ()) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow (T a ()) where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a type TFHelper_0123456789876543210 :: S -> S -> Bool type family TFHelper_0123456789876543210 (a :: S) (a :: S) :: Bool where TFHelper_0123456789876543210 S1 S1 = TrueSym0 TFHelper_0123456789876543210 S1 S2 = FalseSym0 TFHelper_0123456789876543210 S2 S1 = FalseSym0 TFHelper_0123456789876543210 S2 S2 = TrueSym0 - type TFHelper_0123456789876543210Sym0 :: (~>) S ((~>) S Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) S ((~>) S Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @S @((~>) S Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: S -> (~>) S Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: S) :: (~>) S Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @S @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: S -> S -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: S) (a0123456789876543210 :: S) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq S where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: S -> S -> Ordering type family Compare_0123456789876543210 (a :: S) (a :: S) :: Ordering where Compare_0123456789876543210 S1 S1 = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) NilSym0 Compare_0123456789876543210 S2 S2 = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) NilSym0 Compare_0123456789876543210 S1 S2 = LTSym0 Compare_0123456789876543210 S2 S1 = GTSym0 - type Compare_0123456789876543210Sym0 :: (~>) S ((~>) S Ordering) - data Compare_0123456789876543210Sym0 :: (~>) S ((~>) S Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @S @((~>) S Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: S -> (~>) S Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: S) :: (~>) S Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @S @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: S -> S -> Ordering - type family Compare_0123456789876543210Sym2 (a0123456789876543210 :: S) (a0123456789876543210 :: S) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd S where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a type ShowsPrec_0123456789876543210 :: GHC.Num.Natural.Natural -> S -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 (a :: GHC.Num.Natural.Natural) (a :: S) (a :: Symbol) :: Symbol where ShowsPrec_0123456789876543210 _ S1 a_0123456789876543210 = Apply (Apply ShowStringSym0 "S1") a_0123456789876543210 ShowsPrec_0123456789876543210 _ S2 a_0123456789876543210 = Apply (Apply ShowStringSym0 "S2") a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) S ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) S ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) S ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> (~>) S ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) S ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @S @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: GHC.Num.Natural.Natural - -> S -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: S) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (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.Num.Natural.Natural - -> S -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: S) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow S where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a type MinBound_0123456789876543210 :: S type family MinBound_0123456789876543210 :: S where MinBound_0123456789876543210 = S1Sym0 - type MinBound_0123456789876543210Sym0 :: S - type family MinBound_0123456789876543210Sym0 :: S where - MinBound_0123456789876543210Sym0 = MinBound_0123456789876543210 type MaxBound_0123456789876543210 :: S type family MaxBound_0123456789876543210 :: S where MaxBound_0123456789876543210 = S2Sym0 - type MaxBound_0123456789876543210Sym0 :: S - type family MaxBound_0123456789876543210Sym0 :: S where - MaxBound_0123456789876543210Sym0 = MaxBound_0123456789876543210 instance PBounded S where - type MinBound = MinBound_0123456789876543210Sym0 - type MaxBound = MaxBound_0123456789876543210Sym0 + type MinBound = MinBound_0123456789876543210 + type MaxBound = MaxBound_0123456789876543210 type family Case_0123456789876543210 n0123456789876543210 t where Case_0123456789876543210 n 'True = S2Sym0 Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument" @@ -272,38 +112,13 @@ Singletons/StandaloneDeriving.hs:(0,0)-(0,0): Splicing declarations type ToEnum_0123456789876543210 :: GHC.Num.Natural.Natural -> S type family ToEnum_0123456789876543210 (a :: GHC.Num.Natural.Natural) :: S where ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0)) - type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural S - data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural S - where - ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) => - ToEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @S ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ToEnum_0123456789876543210Sym0KindInference ()) - type ToEnum_0123456789876543210Sym1 :: GHC.Num.Natural.Natural -> S - type family ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: S where - ToEnum_0123456789876543210Sym1 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 type FromEnum_0123456789876543210 :: S -> GHC.Num.Natural.Natural type family FromEnum_0123456789876543210 (a :: S) :: GHC.Num.Natural.Natural where FromEnum_0123456789876543210 S1 = FromInteger 0 FromEnum_0123456789876543210 S2 = FromInteger 1 - type FromEnum_0123456789876543210Sym0 :: (~>) S GHC.Num.Natural.Natural - data FromEnum_0123456789876543210Sym0 :: (~>) S GHC.Num.Natural.Natural - where - FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) => - FromEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @S @GHC.Num.Natural.Natural FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) FromEnum_0123456789876543210Sym0KindInference ()) - type FromEnum_0123456789876543210Sym1 :: S - -> GHC.Num.Natural.Natural - type family FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: S) :: GHC.Num.Natural.Natural where - FromEnum_0123456789876543210Sym1 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 instance PEnum S where - type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a - type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a + type ToEnum a = ToEnum_0123456789876543210 a + type FromEnum a = FromEnum_0123456789876543210 a infixl 6 :%*: data ST :: forall a b. T a b -> Type where diff --git a/singletons-base/tests/compile-and-dump/Singletons/Star.golden b/singletons-base/tests/compile-and-dump/Singletons/Star.golden index ee99ee07..e1945117 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/Star.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/Star.golden @@ -75,29 +75,8 @@ Singletons/Star.hs:0:0:: Splicing declarations TFHelper_0123456789876543210 (Vec _ _) String = FalseSym0 TFHelper_0123456789876543210 (Vec _ _) (Maybe _) = FalseSym0 TFHelper_0123456789876543210 (Vec a_0123456789876543210 a_0123456789876543210) (Vec b_0123456789876543210 b_0123456789876543210) = Apply (Apply (&&@#@$) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210) - type TFHelper_0123456789876543210Sym0 :: (~>) Type ((~>) Type Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) Type ((~>) Type Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Type @((~>) Type Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: Type -> (~>) Type Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Type) :: (~>) Type Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Type @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: Type -> Type -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Type) (a0123456789876543210 :: Type) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq Type where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: Type -> Type -> Ordering type family Compare_0123456789876543210 (a :: Type) (a :: Type) :: Ordering where Compare_0123456789876543210 Nat Nat = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) NilSym0 @@ -125,29 +104,8 @@ Singletons/Star.hs:0:0:: Splicing declarations Compare_0123456789876543210 (Vec _ _) Int = GTSym0 Compare_0123456789876543210 (Vec _ _) String = GTSym0 Compare_0123456789876543210 (Vec _ _) (Maybe _) = GTSym0 - type Compare_0123456789876543210Sym0 :: (~>) Type ((~>) Type Ordering) - data Compare_0123456789876543210Sym0 :: (~>) Type ((~>) Type Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Type @((~>) Type Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: Type -> (~>) Type Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Type) :: (~>) Type Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Type @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: Type -> Type -> Ordering - type family Compare_0123456789876543210Sym2 (a0123456789876543210 :: Type) (a0123456789876543210 :: Type) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd Type where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a type ShowsPrec_0123456789876543210 :: GHC.Num.Natural.Natural -> Type -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 (a :: GHC.Num.Natural.Natural) (a :: Type) (a :: Symbol) :: Symbol where @@ -156,41 +114,8 @@ Singletons/Star.hs:0:0:: Splicing declarations ShowsPrec_0123456789876543210 _ String a_0123456789876543210 = Apply (Apply ShowStringSym0 "String") a_0123456789876543210 ShowsPrec_0123456789876543210 p_0123456789876543210 (Maybe arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Maybe ")) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210 ShowsPrec_0123456789876543210 p_0123456789876543210 (Vec arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Vec ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) Type ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) Type ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) Type ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> (~>) Type ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) Type ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Type @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: GHC.Num.Natural.Natural - -> Type -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Type) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (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.Num.Natural.Natural - -> Type -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Type) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow Type where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a data SRep :: Type -> Type where SNat :: SRep (Nat :: Type) diff --git a/singletons-base/tests/compile-and-dump/Singletons/T136.golden b/singletons-base/tests/compile-and-dump/Singletons/T136.golden index be0db148..fd182d37 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T136.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T136.golden @@ -34,35 +34,11 @@ Singletons/T136.hs:(0,0)-(0,0): Splicing declarations Succ_0123456789876543210 '[] = Apply (Apply (:@#@$) TrueSym0) NilSym0 Succ_0123456789876543210 ('(:) 'False as) = Apply (Apply (:@#@$) TrueSym0) as Succ_0123456789876543210 ('(:) 'True as) = Apply (Apply (:@#@$) FalseSym0) (Apply SuccSym0 as) - type Succ_0123456789876543210Sym0 :: (~>) [Bool] [Bool] - data Succ_0123456789876543210Sym0 :: (~>) [Bool] [Bool] - where - Succ_0123456789876543210Sym0KindInference :: SameKind (Apply Succ_0123456789876543210Sym0 arg) (Succ_0123456789876543210Sym1 arg) => - Succ_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @[Bool] @[Bool] Succ_0123456789876543210Sym0 a0123456789876543210 = Succ_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings Succ_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Succ_0123456789876543210Sym0KindInference ()) - type Succ_0123456789876543210Sym1 :: [Bool] -> [Bool] - type family Succ_0123456789876543210Sym1 (a0123456789876543210 :: [Bool]) :: [Bool] where - Succ_0123456789876543210Sym1 a0123456789876543210 = Succ_0123456789876543210 a0123456789876543210 type Pred_0123456789876543210 :: [Bool] -> [Bool] type family Pred_0123456789876543210 (a :: [Bool]) :: [Bool] where Pred_0123456789876543210 '[] = Apply ErrorSym0 "pred 0" Pred_0123456789876543210 ('(:) 'False as) = Apply (Apply (:@#@$) TrueSym0) (Apply PredSym0 as) Pred_0123456789876543210 ('(:) 'True as) = Apply (Apply (:@#@$) FalseSym0) as - type Pred_0123456789876543210Sym0 :: (~>) [Bool] [Bool] - data Pred_0123456789876543210Sym0 :: (~>) [Bool] [Bool] - where - Pred_0123456789876543210Sym0KindInference :: SameKind (Apply Pred_0123456789876543210Sym0 arg) (Pred_0123456789876543210Sym1 arg) => - Pred_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @[Bool] @[Bool] Pred_0123456789876543210Sym0 a0123456789876543210 = Pred_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings Pred_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Pred_0123456789876543210Sym0KindInference ()) - type Pred_0123456789876543210Sym1 :: [Bool] -> [Bool] - type family Pred_0123456789876543210Sym1 (a0123456789876543210 :: [Bool]) :: [Bool] where - Pred_0123456789876543210Sym1 a0123456789876543210 = Pred_0123456789876543210 a0123456789876543210 type family Case_0123456789876543210 i0123456789876543210 arg_01234567898765432100123456789876543210 t where Case_0123456789876543210 i arg_0123456789876543210 'True = NilSym0 Case_0123456789876543210 i arg_0123456789876543210 'False = Apply SuccSym0 (Apply ToEnumSym0 (Apply PredSym0 i)) @@ -75,43 +51,17 @@ Singletons/T136.hs:(0,0)-(0,0): Splicing declarations -> [Bool] type family ToEnum_0123456789876543210 (a :: GHC.Num.Natural.Natural) :: [Bool] where ToEnum_0123456789876543210 arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210 - type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural [Bool] - data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural [Bool] - where - ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) => - ToEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @[Bool] ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ToEnum_0123456789876543210Sym0KindInference ()) - type ToEnum_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> [Bool] - type family ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: [Bool] where - ToEnum_0123456789876543210Sym1 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 type FromEnum_0123456789876543210 :: [Bool] -> GHC.Num.Natural.Natural type family FromEnum_0123456789876543210 (a :: [Bool]) :: GHC.Num.Natural.Natural where FromEnum_0123456789876543210 '[] = FromInteger 0 FromEnum_0123456789876543210 ('(:) 'False as) = Apply (Apply (*@#@$) (FromInteger 2)) (Apply FromEnumSym0 as) FromEnum_0123456789876543210 ('(:) 'True as) = Apply (Apply (+@#@$) (FromInteger 1)) (Apply (Apply (*@#@$) (FromInteger 2)) (Apply FromEnumSym0 as)) - type FromEnum_0123456789876543210Sym0 :: (~>) [Bool] GHC.Num.Natural.Natural - data FromEnum_0123456789876543210Sym0 :: (~>) [Bool] GHC.Num.Natural.Natural - where - FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) => - FromEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @[Bool] @GHC.Num.Natural.Natural FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) FromEnum_0123456789876543210Sym0KindInference ()) - type FromEnum_0123456789876543210Sym1 :: [Bool] - -> GHC.Num.Natural.Natural - type family FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: [Bool]) :: GHC.Num.Natural.Natural where - FromEnum_0123456789876543210Sym1 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 instance PEnum [Bool] where - type Succ a = Apply Succ_0123456789876543210Sym0 a - type Pred a = Apply Pred_0123456789876543210Sym0 a - type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a - type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a + type Succ a = Succ_0123456789876543210 a + type Pred a = Pred_0123456789876543210 a + type ToEnum a = ToEnum_0123456789876543210 a + type FromEnum a = FromEnum_0123456789876543210 a instance SEnum [Bool] where sSucc SNil = applySing (applySing (singFun2 @(:@#@$) SCons) STrue) SNil diff --git a/singletons-base/tests/compile-and-dump/Singletons/T136b.golden b/singletons-base/tests/compile-and-dump/Singletons/T136b.golden index 8095fe57..a228bd09 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T136b.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T136b.golden @@ -33,20 +33,8 @@ Singletons/T136b.hs:(0,0)-(0,0): Splicing declarations type Meth_0123456789876543210 :: Bool -> Bool type family Meth_0123456789876543210 (a :: Bool) :: Bool where Meth_0123456789876543210 a_0123456789876543210 = Apply NotSym0 a_0123456789876543210 - type Meth_0123456789876543210Sym0 :: (~>) Bool Bool - data Meth_0123456789876543210Sym0 :: (~>) Bool Bool - where - Meth_0123456789876543210Sym0KindInference :: SameKind (Apply Meth_0123456789876543210Sym0 arg) (Meth_0123456789876543210Sym1 arg) => - Meth_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Bool @Bool Meth_0123456789876543210Sym0 a0123456789876543210 = Meth_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings Meth_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Meth_0123456789876543210Sym0KindInference ()) - type Meth_0123456789876543210Sym1 :: Bool -> Bool - type family Meth_0123456789876543210Sym1 (a0123456789876543210 :: Bool) :: Bool where - Meth_0123456789876543210Sym1 a0123456789876543210 = Meth_0123456789876543210 a0123456789876543210 instance PC Bool where - type Meth a = Apply Meth_0123456789876543210Sym0 a + type Meth a = Meth_0123456789876543210 a instance SC Bool where sMeth (sA_0123456789876543210 :: Sing a_0123456789876543210) = applySing (singFun1 @NotSym0 sNot) sA_0123456789876543210 diff --git a/singletons-base/tests/compile-and-dump/Singletons/T166.golden b/singletons-base/tests/compile-and-dump/Singletons/T166.golden index 26e43f82..72b3abe3 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T166.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T166.golden @@ -59,22 +59,10 @@ Singletons/T166.hs:(0,0)-(0,0): Splicing declarations type Foo_0123456789876543210 :: forall a. a -> [Bool] type family Foo_0123456789876543210 @a (a :: a) :: [Bool] where Foo_0123456789876543210 @a (x :: a) = Lambda_0123456789876543210Sym0 a x - type Foo_0123456789876543210Sym0 :: forall a. (~>) a [Bool] - data Foo_0123456789876543210Sym0 :: (~>) a [Bool] - where - Foo_0123456789876543210Sym0KindInference :: SameKind (Apply Foo_0123456789876543210Sym0 arg) (Foo_0123456789876543210Sym1 arg) => - Foo_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @a @[Bool] Foo_0123456789876543210Sym0 a0123456789876543210 = Foo_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings Foo_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Foo_0123456789876543210Sym0KindInference ()) - type Foo_0123456789876543210Sym1 :: forall a. a -> [Bool] - type family Foo_0123456789876543210Sym1 @a (a0123456789876543210 :: a) :: [Bool] where - Foo_0123456789876543210Sym1 a0123456789876543210 = Foo_0123456789876543210 a0123456789876543210 class PFoo a where type family FoosPrec (arg :: Natural) (arg :: a) (arg :: [Bool]) :: [Bool] type family Foo (arg :: a) :: [Bool] - type Foo a = Apply Foo_0123456789876543210Sym0 a + type Foo a = Foo_0123456789876543210 a class SFoo a where sFoosPrec :: (forall (t :: Natural) (t :: a) (t :: [Bool]). @@ -87,8 +75,7 @@ Singletons/T166.hs:(0,0)-(0,0): Splicing declarations Sing t -> Sing (Apply FooSym0 t :: [Bool]) :: Type) default sFoo :: (forall (t :: a). - ((Apply FooSym0 t :: [Bool]) - ~ Apply Foo_0123456789876543210Sym0 t) => + ((Foo t :: [Bool]) ~ Foo_0123456789876543210 t) => Sing t -> Sing (Apply FooSym0 t :: [Bool]) :: Type) sFoo (sX :: Sing x) = singFun1 diff --git a/singletons-base/tests/compile-and-dump/Singletons/T167.golden b/singletons-base/tests/compile-and-dump/Singletons/T167.golden index 25f65100..4bc1f276 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T167.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T167.golden @@ -58,72 +58,16 @@ Singletons/T167.hs:(0,0)-(0,0): Splicing declarations type FooList_0123456789876543210 :: forall a. a -> [Bool] -> [Bool] type family FooList_0123456789876543210 @a (a :: a) (a :: [Bool]) :: [Bool] where FooList_0123456789876543210 @a (a_0123456789876543210 :: a) (a_0123456789876543210 :: [Bool]) = Apply (Apply UndefinedSym0 a_0123456789876543210) a_0123456789876543210 - type FooList_0123456789876543210Sym0 :: forall a. (~>) a ((~>) [Bool] [Bool]) - data FooList_0123456789876543210Sym0 :: (~>) a ((~>) [Bool] [Bool]) - where - FooList_0123456789876543210Sym0KindInference :: SameKind (Apply FooList_0123456789876543210Sym0 arg) (FooList_0123456789876543210Sym1 arg) => - FooList_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @a @((~>) [Bool] [Bool]) FooList_0123456789876543210Sym0 a0123456789876543210 = FooList_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings FooList_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) FooList_0123456789876543210Sym0KindInference ()) - type FooList_0123456789876543210Sym1 :: forall a. a - -> (~>) [Bool] [Bool] - data FooList_0123456789876543210Sym1 (a0123456789876543210 :: a) :: (~>) [Bool] [Bool] - where - FooList_0123456789876543210Sym1KindInference :: SameKind (Apply (FooList_0123456789876543210Sym1 a0123456789876543210) arg) (FooList_0123456789876543210Sym2 a0123456789876543210 arg) => - FooList_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @[Bool] @[Bool] (FooList_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FooList_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (FooList_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) FooList_0123456789876543210Sym1KindInference ()) - type FooList_0123456789876543210Sym2 :: forall a. a - -> [Bool] -> [Bool] - type family FooList_0123456789876543210Sym2 @a (a0123456789876543210 :: a) (a0123456789876543210 :: [Bool]) :: [Bool] where - FooList_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = FooList_0123456789876543210 a0123456789876543210 a0123456789876543210 class PFoo a where type family FoosPrec (arg :: Natural) (arg :: a) (arg :: [Bool]) :: [Bool] type family FooList (arg :: a) (arg :: [Bool]) :: [Bool] - type FooList a a = Apply (Apply FooList_0123456789876543210Sym0 a) a + type FooList a a = FooList_0123456789876543210 a a type FoosPrec_0123456789876543210 :: forall a. Natural -> [a] -> [Bool] -> [Bool] type family FoosPrec_0123456789876543210 @a (a :: Natural) (a :: [a]) (a :: [Bool]) :: [Bool] where FoosPrec_0123456789876543210 @a (_ :: Natural) (a_0123456789876543210 :: [a]) (a_0123456789876543210 :: [Bool]) = Apply (Apply FooListSym0 a_0123456789876543210) a_0123456789876543210 - type FoosPrec_0123456789876543210Sym0 :: forall a. (~>) Natural ((~>) [a] ((~>) [Bool] [Bool])) - data FoosPrec_0123456789876543210Sym0 :: (~>) Natural ((~>) [a] ((~>) [Bool] [Bool])) - where - FoosPrec_0123456789876543210Sym0KindInference :: SameKind (Apply FoosPrec_0123456789876543210Sym0 arg) (FoosPrec_0123456789876543210Sym1 arg) => - FoosPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Natural @((~>) [a] ((~>) [Bool] [Bool])) FoosPrec_0123456789876543210Sym0 a0123456789876543210 = FoosPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings FoosPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) FoosPrec_0123456789876543210Sym0KindInference ()) - type FoosPrec_0123456789876543210Sym1 :: forall a. Natural - -> (~>) [a] ((~>) [Bool] [Bool]) - data FoosPrec_0123456789876543210Sym1 (a0123456789876543210 :: Natural) :: (~>) [a] ((~>) [Bool] [Bool]) - where - FoosPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (FoosPrec_0123456789876543210Sym1 a0123456789876543210) arg) (FoosPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - FoosPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @[a] @((~>) [Bool] [Bool]) (FoosPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (FoosPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) FoosPrec_0123456789876543210Sym1KindInference ()) - type FoosPrec_0123456789876543210Sym2 :: forall a. Natural - -> [a] -> (~>) [Bool] [Bool] - data FoosPrec_0123456789876543210Sym2 (a0123456789876543210 :: Natural) (a0123456789876543210 :: [a]) :: (~>) [Bool] [Bool] - where - FoosPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (FoosPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @[Bool] @[Bool] (FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = FoosPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) FoosPrec_0123456789876543210Sym2KindInference ()) - type FoosPrec_0123456789876543210Sym3 :: forall a. Natural - -> [a] -> [Bool] -> [Bool] - type family FoosPrec_0123456789876543210Sym3 @a (a0123456789876543210 :: Natural) (a0123456789876543210 :: [a]) (a0123456789876543210 :: [Bool]) :: [Bool] where - FoosPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = FoosPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PFoo [a] where - type FoosPrec a a a = Apply (Apply (Apply FoosPrec_0123456789876543210Sym0 a) a) a + type FoosPrec a a a = FoosPrec_0123456789876543210 a a a class SFoo a where sFoosPrec :: (forall (t :: Natural) (t :: a) (t :: [Bool]). @@ -138,8 +82,7 @@ Singletons/T167.hs:(0,0)-(0,0): Splicing declarations -> Sing (Apply (Apply FooListSym0 t) t :: [Bool]) :: Type) default sFooList :: (forall (t :: a) (t :: [Bool]). - ((Apply (Apply FooListSym0 t) t :: [Bool]) - ~ Apply (Apply FooList_0123456789876543210Sym0 t) t) => + ((FooList t t :: [Bool]) ~ FooList_0123456789876543210 t t) => Sing t -> Sing t -> Sing (Apply (Apply FooListSym0 t) t :: [Bool]) :: Type) diff --git a/singletons-base/tests/compile-and-dump/Singletons/T175.golden b/singletons-base/tests/compile-and-dump/Singletons/T175.golden index 9662bf12..43d1e0f2 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T175.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T175.golden @@ -35,12 +35,9 @@ Singletons/T175.hs:(0,0)-(0,0): Splicing declarations type Quux1_0123456789876543210 :: forall a. a type family Quux1_0123456789876543210 @a :: a where Quux1_0123456789876543210 @a = BazSym0 - type Quux1_0123456789876543210Sym0 :: forall a. a - type family Quux1_0123456789876543210Sym0 @a :: a where - Quux1_0123456789876543210Sym0 = Quux1_0123456789876543210 class PBar1 a where type family Quux1 :: a - type Quux1 = Quux1_0123456789876543210Sym0 + type Quux1 = Quux1_0123456789876543210 class PBar2 a sQuux2 :: (SBar2 a => Sing (Quux2Sym0 :: a) :: Type) sQuux2 = sBaz @@ -49,7 +46,7 @@ Singletons/T175.hs:(0,0)-(0,0): Splicing declarations class SFoo a => SBar1 a where sQuux1 :: (Sing (Quux1Sym0 :: a) :: Type) default sQuux1 :: - (((Quux1Sym0 :: a) ~ Quux1_0123456789876543210Sym0) => + (((Quux1 :: a) ~ Quux1_0123456789876543210) => Sing (Quux1Sym0 :: a) :: Type) sQuux1 = sBaz class SFoo a => SBar2 a diff --git a/singletons-base/tests/compile-and-dump/Singletons/T178.golden b/singletons-base/tests/compile-and-dump/Singletons/T178.golden index 24fa6616..3585877f 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T178.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T178.golden @@ -42,29 +42,8 @@ Singletons/T178.hs:(0,0)-(0,0): Splicing declarations TFHelper_0123456789876543210 Many Str = FalseSym0 TFHelper_0123456789876543210 Many Opt = FalseSym0 TFHelper_0123456789876543210 Many Many = TrueSym0 - type TFHelper_0123456789876543210Sym0 :: (~>) Occ ((~>) Occ Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) Occ ((~>) Occ Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Occ @((~>) Occ Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: Occ -> (~>) Occ Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Occ) :: (~>) Occ Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Occ @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: Occ -> Occ -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Occ) (a0123456789876543210 :: Occ) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq Occ where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: Occ -> Occ -> Ordering type family Compare_0123456789876543210 (a :: Occ) (a :: Occ) :: Ordering where Compare_0123456789876543210 Str Str = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) NilSym0 @@ -76,70 +55,16 @@ Singletons/T178.hs:(0,0)-(0,0): Splicing declarations Compare_0123456789876543210 Opt Many = LTSym0 Compare_0123456789876543210 Many Str = GTSym0 Compare_0123456789876543210 Many Opt = GTSym0 - type Compare_0123456789876543210Sym0 :: (~>) Occ ((~>) Occ Ordering) - data Compare_0123456789876543210Sym0 :: (~>) Occ ((~>) Occ Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Occ @((~>) Occ Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: Occ -> (~>) Occ Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Occ) :: (~>) Occ Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Occ @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: Occ -> Occ -> Ordering - type family Compare_0123456789876543210Sym2 (a0123456789876543210 :: Occ) (a0123456789876543210 :: Occ) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd Occ where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a type ShowsPrec_0123456789876543210 :: Natural -> Occ -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 (a :: Natural) (a :: Occ) (a :: Symbol) :: Symbol where ShowsPrec_0123456789876543210 _ Str a_0123456789876543210 = Apply (Apply ShowStringSym0 "Str") a_0123456789876543210 ShowsPrec_0123456789876543210 _ Opt a_0123456789876543210 = Apply (Apply ShowStringSym0 "Opt") a_0123456789876543210 ShowsPrec_0123456789876543210 _ Many a_0123456789876543210 = Apply (Apply ShowStringSym0 "Many") a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: (~>) Natural ((~>) Occ ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) Natural ((~>) Occ ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Natural @((~>) Occ ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: Natural - -> (~>) Occ ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: Natural) :: (~>) Occ ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Occ @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: Natural - -> Occ -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: Natural) (a0123456789876543210 :: Occ) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym2KindInference ()) - type ShowsPrec_0123456789876543210Sym3 :: Natural - -> Occ -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: Natural) (a0123456789876543210 :: Occ) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow Occ where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a sEmpty :: (Sing (EmptySym0 :: [(Symbol, Occ)]) :: Type) sEmpty = SNil data SOcc :: Occ -> Type diff --git a/singletons-base/tests/compile-and-dump/Singletons/T187.golden b/singletons-base/tests/compile-and-dump/Singletons/T187.golden index a7f6da89..f4d9a55c 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T187.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T187.golden @@ -11,56 +11,13 @@ Singletons/T187.hs:(0,0)-(0,0): Splicing declarations type TFHelper_0123456789876543210 :: Empty -> Empty -> Bool type family TFHelper_0123456789876543210 (a :: Empty) (a :: Empty) :: Bool where TFHelper_0123456789876543210 _ _ = TrueSym0 - type TFHelper_0123456789876543210Sym0 :: (~>) Empty ((~>) Empty Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) Empty ((~>) Empty Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Empty @((~>) Empty Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: Empty -> (~>) Empty Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Empty) :: (~>) Empty Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Empty @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: Empty -> Empty -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Empty) (a0123456789876543210 :: Empty) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq Empty where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: Empty -> Empty -> Ordering type family Compare_0123456789876543210 (a :: Empty) (a :: Empty) :: Ordering where Compare_0123456789876543210 _ _ = EQSym0 - type Compare_0123456789876543210Sym0 :: (~>) Empty ((~>) Empty Ordering) - data Compare_0123456789876543210Sym0 :: (~>) Empty ((~>) Empty Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Empty @((~>) Empty Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: Empty - -> (~>) Empty Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Empty) :: (~>) Empty Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @Empty @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: Empty -> Empty -> Ordering - type family Compare_0123456789876543210Sym2 (a0123456789876543210 :: Empty) (a0123456789876543210 :: Empty) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd Empty where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a data SEmpty :: Empty -> Type type instance Sing @Empty = SEmpty instance SingKind Empty where diff --git a/singletons-base/tests/compile-and-dump/Singletons/T190.golden b/singletons-base/tests/compile-and-dump/Singletons/T190.golden index da0f8ee1..f51bab20 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T190.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T190.golden @@ -13,146 +13,40 @@ Singletons/T190.hs:0:0:: Splicing declarations 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 @T @((~>) T Bool) 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 @T @Bool (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 (==) 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 - 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 @T @((~>) T Ordering) 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 @T @Ordering (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 Compare a a = Compare_0123456789876543210 a a type family Case_0123456789876543210 n0123456789876543210 t where Case_0123456789876543210 n 'True = TSym0 Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument" type ToEnum_0123456789876543210 :: GHC.Num.Natural.Natural -> T type family ToEnum_0123456789876543210 (a :: GHC.Num.Natural.Natural) :: T where ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0)) - type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural T - data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural T - where - ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) => - ToEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @T ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ToEnum_0123456789876543210Sym0KindInference ()) - type ToEnum_0123456789876543210Sym1 :: GHC.Num.Natural.Natural -> T - type family ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: T where - ToEnum_0123456789876543210Sym1 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 type FromEnum_0123456789876543210 :: T -> GHC.Num.Natural.Natural type family FromEnum_0123456789876543210 (a :: T) :: GHC.Num.Natural.Natural where FromEnum_0123456789876543210 T = FromInteger 0 - type FromEnum_0123456789876543210Sym0 :: (~>) T GHC.Num.Natural.Natural - data FromEnum_0123456789876543210Sym0 :: (~>) T GHC.Num.Natural.Natural - where - FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) => - FromEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @T @GHC.Num.Natural.Natural FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) FromEnum_0123456789876543210Sym0KindInference ()) - type FromEnum_0123456789876543210Sym1 :: T - -> GHC.Num.Natural.Natural - type family FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: T) :: GHC.Num.Natural.Natural 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 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 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 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 - type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> (~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) 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 @T @((~>) GHC.Types.Symbol GHC.Types.Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: GHC.Num.Natural.Natural - -> T -> (~>) GHC.Types.Symbol GHC.Types.Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (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 @GHC.Types.Symbol @GHC.Types.Symbol (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.Num.Natural.Natural - -> T -> GHC.Types.Symbol -> GHC.Types.Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Num.Natural.Natural) (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 + 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 diff --git a/singletons-base/tests/compile-and-dump/Singletons/T271.golden b/singletons-base/tests/compile-and-dump/Singletons/T271.golden index 6a77737f..b77b13fd 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T271.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T271.golden @@ -41,120 +41,26 @@ Singletons/T271.hs:(0,0)-(0,0): Splicing declarations -> Constant a b -> Bool type family TFHelper_0123456789876543210 @a @b (a :: Constant a b) (a :: Constant a b) :: Bool where TFHelper_0123456789876543210 @a @b (Constant a_0123456789876543210 :: Constant a b) (Constant b_0123456789876543210 :: Constant a b) = Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210 - type TFHelper_0123456789876543210Sym0 :: forall a - b. (~>) (Constant a b) ((~>) (Constant a b) Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) (Constant a b) ((~>) (Constant a b) Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @(Constant a b) @((~>) (Constant a b) Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: forall a b. Constant a b - -> (~>) (Constant a b) Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Constant a b) :: (~>) (Constant a b) Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Constant a b) @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: forall a b. Constant a b - -> Constant a b -> Bool - type family TFHelper_0123456789876543210Sym2 @a @b (a0123456789876543210 :: Constant a b) (a0123456789876543210 :: Constant a b) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq (Constant a b) where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: forall a b. Constant a b -> Constant a b -> Ordering type family Compare_0123456789876543210 @a @b (a :: Constant a b) (a :: Constant a b) :: Ordering where Compare_0123456789876543210 @a @b (Constant a_0123456789876543210 :: Constant a b) (Constant b_0123456789876543210 :: Constant a b) = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0) - type Compare_0123456789876543210Sym0 :: forall a - b. (~>) (Constant a b) ((~>) (Constant a b) Ordering) - data Compare_0123456789876543210Sym0 :: (~>) (Constant a b) ((~>) (Constant a b) Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @(Constant a b) @((~>) (Constant a b) Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: forall a b. Constant a b - -> (~>) (Constant a b) Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Constant a b) :: (~>) (Constant a b) Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Constant a b) @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: forall a b. Constant a b - -> Constant a b -> Ordering - type family Compare_0123456789876543210Sym2 @a @b (a0123456789876543210 :: Constant a b) (a0123456789876543210 :: Constant a b) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd (Constant a b) where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a type TFHelper_0123456789876543210 :: forall a. Identity a -> Identity a -> Bool type family TFHelper_0123456789876543210 @a (a :: Identity a) (a :: Identity a) :: Bool where TFHelper_0123456789876543210 @a (Identity a_0123456789876543210 :: Identity a) (Identity b_0123456789876543210 :: Identity a) = Apply (Apply (==@#@$) a_0123456789876543210) b_0123456789876543210 - type TFHelper_0123456789876543210Sym0 :: forall a. (~>) (Identity a) ((~>) (Identity a) Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) (Identity a) ((~>) (Identity a) Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @(Identity a) @((~>) (Identity a) Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: forall a. Identity a - -> (~>) (Identity a) Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Identity a) :: (~>) (Identity a) Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Identity a) @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: forall a. Identity a - -> Identity a -> Bool - type family TFHelper_0123456789876543210Sym2 @a (a0123456789876543210 :: Identity a) (a0123456789876543210 :: Identity a) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq (Identity a) where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: forall a. Identity a -> Identity a -> Ordering type family Compare_0123456789876543210 @a (a :: Identity a) (a :: Identity a) :: Ordering where Compare_0123456789876543210 @a (Identity a_0123456789876543210 :: Identity a) (Identity b_0123456789876543210 :: Identity a) = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0) - type Compare_0123456789876543210Sym0 :: forall a. (~>) (Identity a) ((~>) (Identity a) Ordering) - data Compare_0123456789876543210Sym0 :: (~>) (Identity a) ((~>) (Identity a) Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @(Identity a) @((~>) (Identity a) Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: forall a. Identity a - -> (~>) (Identity a) Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Identity a) :: (~>) (Identity a) Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @(Identity a) @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: forall a. Identity a - -> Identity a -> Ordering - type family Compare_0123456789876543210Sym2 @a (a0123456789876543210 :: Identity a) (a0123456789876543210 :: Identity a) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd (Identity a) where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a data SConstant :: forall (a :: Type) (b :: Type). Constant a b -> Type where diff --git a/singletons-base/tests/compile-and-dump/Singletons/T287.golden b/singletons-base/tests/compile-and-dump/Singletons/T287.golden index 262f117f..1a46d818 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T287.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T287.golden @@ -47,32 +47,8 @@ Singletons/T287.hs:(0,0)-(0,0): Splicing declarations -> (~>) a b -> (~>) a b type family TFHelper_0123456789876543210 @a @b (a :: (~>) a b) (a :: (~>) a b) :: (~>) a b where TFHelper_0123456789876543210 @a @b (f :: (~>) a b) (g :: (~>) a b) = Lambda_0123456789876543210Sym0 a b f g - type TFHelper_0123456789876543210Sym0 :: forall a - b. (~>) ((~>) a b) ((~>) ((~>) a b) ((~>) a b)) - data TFHelper_0123456789876543210Sym0 :: (~>) ((~>) a b) ((~>) ((~>) a b) ((~>) a b)) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @((~>) a b) @((~>) ((~>) a b) ((~>) a b)) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: forall a b. (~>) a b - -> (~>) ((~>) a b) ((~>) a b) - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a b) :: (~>) ((~>) a b) ((~>) a b) - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @((~>) a b) @((~>) a b) (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: forall a b. (~>) a b - -> (~>) a b -> (~>) a b - type family TFHelper_0123456789876543210Sym2 @a @b (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: (~>) a b) :: (~>) a b where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PS ((~>) a b) where - type (<<>>) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (<<>>) a a = TFHelper_0123456789876543210 a a class SS a where (%<<>>) :: (forall (t :: a) (t :: a). diff --git a/singletons-base/tests/compile-and-dump/Singletons/T312.golden b/singletons-base/tests/compile-and-dump/Singletons/T312.golden index e24c8630..d0551a22 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T312.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T312.golden @@ -60,27 +60,6 @@ Singletons/T312.hs:(0,0)-(0,0): Splicing declarations type Bar_0123456789876543210 :: forall a b. a -> b -> b type family Bar_0123456789876543210 @a @b (a :: a) (a :: b) :: b where Bar_0123456789876543210 @a @b (_ :: a) (x :: b) = x - type Bar_0123456789876543210Sym0 :: forall a b. (~>) a ((~>) b b) - data Bar_0123456789876543210Sym0 :: (~>) a ((~>) b b) - where - Bar_0123456789876543210Sym0KindInference :: SameKind (Apply Bar_0123456789876543210Sym0 arg) (Bar_0123456789876543210Sym1 arg) => - Bar_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @a @((~>) b b) Bar_0123456789876543210Sym0 a0123456789876543210 = Bar_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Bar_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Bar_0123456789876543210Sym0KindInference ()) - type Bar_0123456789876543210Sym1 :: forall a b. a -> (~>) b b - data Bar_0123456789876543210Sym1 (a0123456789876543210 :: a) :: (~>) b b - where - Bar_0123456789876543210Sym1KindInference :: SameKind (Apply (Bar_0123456789876543210Sym1 a0123456789876543210) arg) (Bar_0123456789876543210Sym2 a0123456789876543210 arg) => - Bar_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @b @b (Bar_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Bar_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Bar_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Bar_0123456789876543210Sym1KindInference ()) - type Bar_0123456789876543210Sym2 :: forall a b. a -> b -> b - type family Bar_0123456789876543210Sym2 @a @b (a0123456789876543210 :: a) (a0123456789876543210 :: b) :: b where - Bar_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Bar_0123456789876543210 a0123456789876543210 a0123456789876543210 data Let0123456789876543210HSym0 a0123456789876543210 b0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 :: (~>) c0123456789876543210 ((~>) b0123456789876543210 b0123456789876543210) where Let0123456789876543210HSym0KindInference :: SameKind (Apply (Let0123456789876543210HSym0 a0123456789876543210 b0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Let0123456789876543210HSym1 a0123456789876543210 b0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) => @@ -104,32 +83,11 @@ Singletons/T312.hs:(0,0)-(0,0): Splicing declarations type Baz_0123456789876543210 :: forall a b. a -> b -> b type family Baz_0123456789876543210 @a @b (a :: a) (a :: b) :: b where Baz_0123456789876543210 @a @b (a_0123456789876543210 :: a) (a_0123456789876543210 :: b) = Apply (Apply (Let0123456789876543210HSym0 a b a_0123456789876543210 a_0123456789876543210) a_0123456789876543210) a_0123456789876543210 - type Baz_0123456789876543210Sym0 :: forall a b. (~>) a ((~>) b b) - data Baz_0123456789876543210Sym0 :: (~>) a ((~>) b b) - where - Baz_0123456789876543210Sym0KindInference :: SameKind (Apply Baz_0123456789876543210Sym0 arg) (Baz_0123456789876543210Sym1 arg) => - Baz_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @a @((~>) b b) Baz_0123456789876543210Sym0 a0123456789876543210 = Baz_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Baz_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Baz_0123456789876543210Sym0KindInference ()) - type Baz_0123456789876543210Sym1 :: forall a b. a -> (~>) b b - data Baz_0123456789876543210Sym1 (a0123456789876543210 :: a) :: (~>) b b - where - Baz_0123456789876543210Sym1KindInference :: SameKind (Apply (Baz_0123456789876543210Sym1 a0123456789876543210) arg) (Baz_0123456789876543210Sym2 a0123456789876543210 arg) => - Baz_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @b @b (Baz_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Baz_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Baz_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Baz_0123456789876543210Sym1KindInference ()) - type Baz_0123456789876543210Sym2 :: forall a b. a -> b -> b - type family Baz_0123456789876543210Sym2 @a @b (a0123456789876543210 :: a) (a0123456789876543210 :: b) :: b where - Baz_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Baz_0123456789876543210 a0123456789876543210 a0123456789876543210 class PFoo a where type family Bar (arg :: a) (arg :: b) :: b type family Baz (arg :: a) (arg :: b) :: b - type Bar a a = Apply (Apply Bar_0123456789876543210Sym0 a) a - type Baz a a = Apply (Apply Baz_0123456789876543210Sym0 a) a + type Bar a a = Bar_0123456789876543210 a a + type Baz a a = Baz_0123456789876543210 a a class SFoo a where sBar :: (forall (t :: a) (t :: b). @@ -139,12 +97,11 @@ Singletons/T312.hs:(0,0)-(0,0): Splicing declarations -> Sing t -> Sing (Apply (Apply BazSym0 t) t :: b) default sBar :: (forall (t :: a) (t :: b). - ((Apply (Apply BarSym0 t) t :: b) - ~ Apply (Apply Bar_0123456789876543210Sym0 t) t) => + ((Bar t t :: b) ~ Bar_0123456789876543210 t t) => Sing t -> Sing t -> Sing (Apply (Apply BarSym0 t) t :: b) :: Type) default sBaz :: - forall b (t :: a) (t :: b). ((Apply (Apply BazSym0 t) t :: b) - ~ Apply (Apply Baz_0123456789876543210Sym0 t) t) => + forall b (t :: a) (t :: b). ((Baz t t :: b) + ~ Baz_0123456789876543210 t t) => Sing t -> Sing t -> Sing (Apply (Apply BazSym0 t) t :: b) sBar _ (sX :: Sing x) = sX diff --git a/singletons-base/tests/compile-and-dump/Singletons/T358.golden b/singletons-base/tests/compile-and-dump/Singletons/T358.golden index aa678838..adf8f0ff 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T358.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T358.golden @@ -58,44 +58,17 @@ Singletons/T358.hs:(0,0)-(0,0): Splicing declarations type Method1_0123456789876543210 :: forall a. [a] type family Method1_0123456789876543210 @a :: [a] where Method1_0123456789876543210 @a = NilSym0 - type Method1_0123456789876543210Sym0 :: forall a. [a] - type family Method1_0123456789876543210Sym0 @a :: [a] where - Method1_0123456789876543210Sym0 = Method1_0123456789876543210 instance PC1 [] where - type Method1 = Method1_0123456789876543210Sym0 + type Method1 = Method1_0123456789876543210 type Method2a_0123456789876543210 :: forall b a. b -> [a] type family Method2a_0123456789876543210 @b @a (a :: b) :: [a] where Method2a_0123456789876543210 @b @a (_ :: b) = NilSym0 - type Method2a_0123456789876543210Sym0 :: forall b a. (~>) b [a] - data Method2a_0123456789876543210Sym0 :: (~>) b [a] - where - Method2a_0123456789876543210Sym0KindInference :: SameKind (Apply Method2a_0123456789876543210Sym0 arg) (Method2a_0123456789876543210Sym1 arg) => - Method2a_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @b @[a] Method2a_0123456789876543210Sym0 a0123456789876543210 = Method2a_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings Method2a_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Method2a_0123456789876543210Sym0KindInference ()) - type Method2a_0123456789876543210Sym1 :: forall b a. b -> [a] - type family Method2a_0123456789876543210Sym1 @b @a (a0123456789876543210 :: b) :: [a] where - Method2a_0123456789876543210Sym1 a0123456789876543210 = Method2a_0123456789876543210 a0123456789876543210 type Method2b_0123456789876543210 :: forall b a. b -> [a] type family Method2b_0123456789876543210 @b @a (a :: b) :: [a] where Method2b_0123456789876543210 @b @a (_ :: b) = NilSym0 - type Method2b_0123456789876543210Sym0 :: forall b a. (~>) b [a] - data Method2b_0123456789876543210Sym0 :: (~>) b [a] - where - Method2b_0123456789876543210Sym0KindInference :: SameKind (Apply Method2b_0123456789876543210Sym0 arg) (Method2b_0123456789876543210Sym1 arg) => - Method2b_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @b @[a] Method2b_0123456789876543210Sym0 a0123456789876543210 = Method2b_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings Method2b_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Method2b_0123456789876543210Sym0KindInference ()) - type Method2b_0123456789876543210Sym1 :: forall b a. b -> [a] - type family Method2b_0123456789876543210Sym1 @b @a (a0123456789876543210 :: b) :: [a] where - Method2b_0123456789876543210Sym1 a0123456789876543210 = Method2b_0123456789876543210 a0123456789876543210 instance PC2 [a] where - type Method2a a = Apply Method2a_0123456789876543210Sym0 a - type Method2b a = Apply Method2b_0123456789876543210Sym0 a + type Method2a a = Method2a_0123456789876543210 a + type Method2b a = Method2b_0123456789876543210 a class SC1 (f :: k -> Type) where sMethod1 :: (Sing (Method1Sym0 :: f a) :: Type) class SC2 a where diff --git a/singletons-base/tests/compile-and-dump/Singletons/T371.golden b/singletons-base/tests/compile-and-dump/Singletons/T371.golden index 5b75cc50..293afbb2 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T371.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T371.golden @@ -46,85 +46,15 @@ Singletons/T371.hs:(0,0)-(0,0): Splicing declarations type family ShowsPrec_0123456789876543210 @a (a :: GHC.Num.Natural.Natural) (a :: X a) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where ShowsPrec_0123456789876543210 @a (_ :: GHC.Num.Natural.Natural) (X1 :: X a) (a_0123456789876543210 :: GHC.Types.Symbol) = Apply (Apply ShowStringSym0 "X1") a_0123456789876543210 ShowsPrec_0123456789876543210 @a (p_0123456789876543210 :: GHC.Num.Natural.Natural) (X2 arg_0123456789876543210 :: X a) (a_0123456789876543210 :: GHC.Types.Symbol) = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "X2 ")) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: forall a. (~>) GHC.Num.Natural.Natural ((~>) (X a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) (X a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) (X a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: forall a. GHC.Num.Natural.Natural - -> (~>) (X a) ((~>) GHC.Types.Symbol GHC.Types.Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) (X a) ((~>) 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 @(X a) @((~>) GHC.Types.Symbol GHC.Types.Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: forall a. GHC.Num.Natural.Natural - -> X a - -> (~>) GHC.Types.Symbol GHC.Types.Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: X a) :: (~>) 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 @GHC.Types.Symbol @GHC.Types.Symbol (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym2KindInference ()) - type ShowsPrec_0123456789876543210Sym3 :: forall a. GHC.Num.Natural.Natural - -> X a - -> GHC.Types.Symbol -> GHC.Types.Symbol - type family ShowsPrec_0123456789876543210Sym3 @a (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: X a) (a0123456789876543210 :: GHC.Types.Symbol) :: GHC.Types.Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow (X a) where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a type ShowsPrec_0123456789876543210 :: forall a. GHC.Num.Natural.Natural -> Y a -> GHC.Types.Symbol -> GHC.Types.Symbol type family ShowsPrec_0123456789876543210 @a (a :: GHC.Num.Natural.Natural) (a :: Y a) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where ShowsPrec_0123456789876543210 @a (_ :: GHC.Num.Natural.Natural) (Y1 :: Y a) (a_0123456789876543210 :: GHC.Types.Symbol) = Apply (Apply ShowStringSym0 "Y1") a_0123456789876543210 ShowsPrec_0123456789876543210 @a (p_0123456789876543210 :: GHC.Num.Natural.Natural) (Y2 arg_0123456789876543210 :: Y a) (a_0123456789876543210 :: GHC.Types.Symbol) = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Y2 ")) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: forall a. (~>) GHC.Num.Natural.Natural ((~>) (Y a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) (Y a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) (Y a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: forall a. GHC.Num.Natural.Natural - -> (~>) (Y a) ((~>) GHC.Types.Symbol GHC.Types.Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) (Y a) ((~>) 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 @(Y a) @((~>) GHC.Types.Symbol GHC.Types.Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: forall a. GHC.Num.Natural.Natural - -> Y a - -> (~>) GHC.Types.Symbol GHC.Types.Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Y a) :: (~>) 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 @GHC.Types.Symbol @GHC.Types.Symbol (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym2KindInference ()) - type ShowsPrec_0123456789876543210Sym3 :: forall a. GHC.Num.Natural.Natural - -> Y a - -> GHC.Types.Symbol -> GHC.Types.Symbol - type family ShowsPrec_0123456789876543210Sym3 @a (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: Y a) (a0123456789876543210 :: GHC.Types.Symbol) :: GHC.Types.Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow (Y a) where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a data SX :: forall (a :: Type). X a -> Type where SX1 :: forall (a :: Type). SX (X1 :: X a) diff --git a/singletons-base/tests/compile-and-dump/Singletons/T410.golden b/singletons-base/tests/compile-and-dump/Singletons/T410.golden index a45585ab..6394375f 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T410.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T410.golden @@ -36,26 +36,5 @@ Singletons/T410.hs:(0,0)-(0,0): Splicing declarations type Equals_0123456789876543210 :: () -> () -> Bool type family Equals_0123456789876543210 (a :: ()) (a :: ()) :: Bool where Equals_0123456789876543210 '() '() = TrueSym0 - type Equals_0123456789876543210Sym0 :: (~>) () ((~>) () Bool) - data Equals_0123456789876543210Sym0 :: (~>) () ((~>) () Bool) - where - Equals_0123456789876543210Sym0KindInference :: SameKind (Apply Equals_0123456789876543210Sym0 arg) (Equals_0123456789876543210Sym1 arg) => - Equals_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @() @((~>) () Bool) Equals_0123456789876543210Sym0 a0123456789876543210 = Equals_0123456789876543210Sym1 a0123456789876543210 - instance Data.Singletons.TH.SuppressUnusedWarnings.SuppressUnusedWarnings Equals_0123456789876543210Sym0 where - Data.Singletons.TH.SuppressUnusedWarnings.suppressUnusedWarnings - = snd ((,) Equals_0123456789876543210Sym0KindInference ()) - type Equals_0123456789876543210Sym1 :: () -> (~>) () Bool - data Equals_0123456789876543210Sym1 (a0123456789876543210 :: ()) :: (~>) () Bool - where - Equals_0123456789876543210Sym1KindInference :: SameKind (Apply (Equals_0123456789876543210Sym1 a0123456789876543210) arg) (Equals_0123456789876543210Sym2 a0123456789876543210 arg) => - Equals_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @() @Bool (Equals_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Equals_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance Data.Singletons.TH.SuppressUnusedWarnings.SuppressUnusedWarnings (Equals_0123456789876543210Sym1 a0123456789876543210) where - Data.Singletons.TH.SuppressUnusedWarnings.suppressUnusedWarnings - = snd ((,) Equals_0123456789876543210Sym1KindInference ()) - type Equals_0123456789876543210Sym2 :: () -> () -> Bool - type family Equals_0123456789876543210Sym2 (a0123456789876543210 :: ()) (a0123456789876543210 :: ()) :: Bool where - Equals_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Equals_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq () where - type Equals a a = Apply (Apply Equals_0123456789876543210Sym0 a) a + type Equals a a = Equals_0123456789876543210 a a diff --git a/singletons-base/tests/compile-and-dump/Singletons/T555.golden b/singletons-base/tests/compile-and-dump/Singletons/T555.golden index 121d8142..2deb781f 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T555.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T555.golden @@ -20,31 +20,8 @@ Singletons/T555.hs:(0,0)-(0,0): Splicing declarations TFHelper_0123456789876543210 Location Quaternion = FalseSym0 TFHelper_0123456789876543210 Quaternion Location = FalseSym0 TFHelper_0123456789876543210 Quaternion Quaternion = TrueSym0 - type TFHelper_0123456789876543210Sym0 :: (~>) MyPropKind ((~>) MyPropKind Bool) - data TFHelper_0123456789876543210Sym0 :: (~>) MyPropKind ((~>) MyPropKind Bool) - where - TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) => - TFHelper_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @MyPropKind @((~>) MyPropKind Bool) TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym0KindInference ()) - type TFHelper_0123456789876543210Sym1 :: MyPropKind - -> (~>) MyPropKind Bool - data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: MyPropKind) :: (~>) MyPropKind Bool - where - TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) => - TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @MyPropKind @Bool (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) TFHelper_0123456789876543210Sym1KindInference ()) - type TFHelper_0123456789876543210Sym2 :: MyPropKind - -> MyPropKind -> Bool - type family TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: MyPropKind) (a0123456789876543210 :: MyPropKind) :: Bool where - TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PEq MyPropKind where - type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a + type (==) a a = TFHelper_0123456789876543210 a a type Compare_0123456789876543210 :: MyPropKind -> MyPropKind -> Ordering type family Compare_0123456789876543210 (a :: MyPropKind) (a :: MyPropKind) :: Ordering where @@ -52,71 +29,15 @@ Singletons/T555.hs:(0,0)-(0,0): Splicing declarations Compare_0123456789876543210 Quaternion Quaternion = Apply (Apply (Apply FoldlSym0 (<>@#@$)) EQSym0) NilSym0 Compare_0123456789876543210 Location Quaternion = LTSym0 Compare_0123456789876543210 Quaternion Location = GTSym0 - type Compare_0123456789876543210Sym0 :: (~>) MyPropKind ((~>) MyPropKind Ordering) - data Compare_0123456789876543210Sym0 :: (~>) MyPropKind ((~>) MyPropKind Ordering) - where - Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) => - Compare_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @MyPropKind @((~>) MyPropKind Ordering) Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym0KindInference ()) - type Compare_0123456789876543210Sym1 :: MyPropKind - -> (~>) MyPropKind Ordering - data Compare_0123456789876543210Sym1 (a0123456789876543210 :: MyPropKind) :: (~>) MyPropKind Ordering - where - Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) => - Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @MyPropKind @Ordering (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) Compare_0123456789876543210Sym1KindInference ()) - type Compare_0123456789876543210Sym2 :: MyPropKind - -> MyPropKind -> Ordering - type family Compare_0123456789876543210Sym2 (a0123456789876543210 :: MyPropKind) (a0123456789876543210 :: MyPropKind) :: Ordering where - Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 instance POrd MyPropKind where - type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a + type Compare a a = Compare_0123456789876543210 a a type ShowsPrec_0123456789876543210 :: GHC.Num.Natural.Natural -> MyPropKind -> Symbol -> Symbol type family ShowsPrec_0123456789876543210 (a :: GHC.Num.Natural.Natural) (a :: MyPropKind) (a :: Symbol) :: Symbol where ShowsPrec_0123456789876543210 _ Location a_0123456789876543210 = Apply (Apply ShowStringSym0 "Location") a_0123456789876543210 ShowsPrec_0123456789876543210 _ Quaternion a_0123456789876543210 = Apply (Apply ShowStringSym0 "Quaternion") a_0123456789876543210 - type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) MyPropKind ((~>) Symbol Symbol)) - data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural ((~>) MyPropKind ((~>) Symbol Symbol)) - where - ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) => - ShowsPrec_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @((~>) MyPropKind ((~>) Symbol Symbol)) ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym0KindInference ()) - type ShowsPrec_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> (~>) MyPropKind ((~>) Symbol Symbol) - data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: (~>) MyPropKind ((~>) Symbol Symbol) - where - ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @MyPropKind @((~>) Symbol Symbol) (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) ShowsPrec_0123456789876543210Sym1KindInference ()) - type ShowsPrec_0123456789876543210Sym2 :: GHC.Num.Natural.Natural - -> MyPropKind -> (~>) Symbol Symbol - data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: MyPropKind) :: (~>) Symbol Symbol - where - ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) => - ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210 - type instance Apply @Symbol @Symbol (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.Num.Natural.Natural - -> MyPropKind -> Symbol -> Symbol - type family ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Num.Natural.Natural) (a0123456789876543210 :: MyPropKind) (a0123456789876543210 :: Symbol) :: Symbol where - ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 instance PShow MyPropKind where - type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a + type ShowsPrec a a a = ShowsPrec_0123456789876543210 a a a data SMyPropKind :: MyPropKind -> Type where SLocation :: SMyPropKind (Location :: MyPropKind) diff --git a/singletons-base/tests/compile-and-dump/Singletons/T581.golden b/singletons-base/tests/compile-and-dump/Singletons/T581.golden index 3ba3447c..998fb576 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T581.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T581.golden @@ -63,24 +63,9 @@ Singletons/T581.hs:(0,0)-(0,0): Splicing declarations type family M1_0123456789876543210 @a @b (a :: a) :: Maybe (a, b) where M1_0123456789876543210 @a @b (_ :: a) = NothingSym0 :: Maybe (a, b) - type M1_0123456789876543210Sym0 :: forall a b. (~>) a (Maybe (a, - b)) - data M1_0123456789876543210Sym0 :: (~>) a (Maybe (a, b)) - where - M1_0123456789876543210Sym0KindInference :: SameKind (Apply M1_0123456789876543210Sym0 arg) (M1_0123456789876543210Sym1 arg) => - M1_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @a @(Maybe (a, - b)) M1_0123456789876543210Sym0 a0123456789876543210 = M1_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings M1_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) M1_0123456789876543210Sym0KindInference ()) - type M1_0123456789876543210Sym1 :: forall a b. a -> Maybe (a, b) - type family M1_0123456789876543210Sym1 @a @b (a0123456789876543210 :: a) :: Maybe (a, - b) where - M1_0123456789876543210Sym1 a0123456789876543210 = M1_0123456789876543210 a0123456789876543210 class PC1 a where type family M1 (arg :: a) :: Maybe (a, b) - type M1 a = Apply M1_0123456789876543210Sym0 a + type M1 a = M1_0123456789876543210 a type M2Sym0 :: forall b a. (~>) b (Maybe a) data M2Sym0 :: (~>) b (Maybe a) where @@ -95,21 +80,9 @@ Singletons/T581.hs:(0,0)-(0,0): Splicing declarations type M2_0123456789876543210 :: forall b a. b -> Maybe a type family M2_0123456789876543210 @b @a (a :: b) :: Maybe a where M2_0123456789876543210 @b @a (_ :: b) = NothingSym0 :: Maybe a - type M2_0123456789876543210Sym0 :: forall b a. (~>) b (Maybe a) - data M2_0123456789876543210Sym0 :: (~>) b (Maybe a) - where - M2_0123456789876543210Sym0KindInference :: SameKind (Apply M2_0123456789876543210Sym0 arg) (M2_0123456789876543210Sym1 arg) => - M2_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @b @(Maybe a) M2_0123456789876543210Sym0 a0123456789876543210 = M2_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings M2_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) M2_0123456789876543210Sym0KindInference ()) - type M2_0123456789876543210Sym1 :: forall b a. b -> Maybe a - type family M2_0123456789876543210Sym1 @b @a (a0123456789876543210 :: b) :: Maybe a where - M2_0123456789876543210Sym1 a0123456789876543210 = M2_0123456789876543210 a0123456789876543210 class PC2 a where type family M2 (arg :: b) :: Maybe a - type M2 a = Apply M2_0123456789876543210Sym0 a + type M2 a = M2_0123456789876543210 a type M3Sym0 :: forall a b. (~>) a ((~>) b (a, b)) data M3Sym0 :: (~>) a ((~>) b (a, b)) where @@ -137,93 +110,26 @@ Singletons/T581.hs:(0,0)-(0,0): Splicing declarations b) where M3_0123456789876543210 @a @b (x :: a) (y :: b) = Apply (Apply Tuple2Sym0 x) y :: (a, b) - type M3_0123456789876543210Sym0 :: forall a b. (~>) a ((~>) b (a, - b)) - data M3_0123456789876543210Sym0 :: (~>) a ((~>) b (a, b)) - where - M3_0123456789876543210Sym0KindInference :: SameKind (Apply M3_0123456789876543210Sym0 arg) (M3_0123456789876543210Sym1 arg) => - M3_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @a @((~>) b (a, - b)) M3_0123456789876543210Sym0 a0123456789876543210 = M3_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings M3_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) M3_0123456789876543210Sym0KindInference ()) - type M3_0123456789876543210Sym1 :: forall a b. a -> (~>) b (a, b) - data M3_0123456789876543210Sym1 (a0123456789876543210 :: a) :: (~>) b (a, - b) - where - M3_0123456789876543210Sym1KindInference :: SameKind (Apply (M3_0123456789876543210Sym1 a0123456789876543210) arg) (M3_0123456789876543210Sym2 a0123456789876543210 arg) => - M3_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @b @(a, - b) (M3_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = M3_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (M3_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) M3_0123456789876543210Sym1KindInference ()) - type M3_0123456789876543210Sym2 :: forall a b. a -> b -> (a, b) - type family M3_0123456789876543210Sym2 @a @b (a0123456789876543210 :: a) (a0123456789876543210 :: b) :: (a, - b) where - M3_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = M3_0123456789876543210 a0123456789876543210 a0123456789876543210 class PC3 a where type family M3 (arg :: a) (arg :: b) :: (a, b) - type M3 a a = Apply (Apply M3_0123456789876543210Sym0 a) a + type M3 a a = M3_0123456789876543210 a a type M1_0123456789876543210 :: forall a b. [a] -> Maybe ([a], b) type family M1_0123456789876543210 @a @b (a :: [a]) :: Maybe ([a], b) where M1_0123456789876543210 @a @b (_ :: [a]) = NothingSym0 :: Maybe ([a], b) - type M1_0123456789876543210Sym0 :: forall a - b. (~>) [a] (Maybe ([a], b)) - data M1_0123456789876543210Sym0 :: (~>) [a] (Maybe ([a], b)) - where - M1_0123456789876543210Sym0KindInference :: SameKind (Apply M1_0123456789876543210Sym0 arg) (M1_0123456789876543210Sym1 arg) => - M1_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @[a] @(Maybe ([a], - b)) M1_0123456789876543210Sym0 a0123456789876543210 = M1_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings M1_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) M1_0123456789876543210Sym0KindInference ()) - type M1_0123456789876543210Sym1 :: forall a b. [a] - -> Maybe ([a], b) - type family M1_0123456789876543210Sym1 @a @b (a0123456789876543210 :: [a]) :: Maybe ([a], - b) where - M1_0123456789876543210Sym1 a0123456789876543210 = M1_0123456789876543210 a0123456789876543210 instance PC1 [a] where - type M1 a = Apply M1_0123456789876543210Sym0 a + type M1 a = M1_0123456789876543210 a type M2_0123456789876543210 :: forall b a. b -> Maybe [a] type family M2_0123456789876543210 @b @a (a :: b) :: Maybe [a] where M2_0123456789876543210 @b @a (_ :: b) = NothingSym0 :: Maybe [a] - type M2_0123456789876543210Sym0 :: forall b a. (~>) b (Maybe [a]) - data M2_0123456789876543210Sym0 :: (~>) b (Maybe [a]) - where - M2_0123456789876543210Sym0KindInference :: SameKind (Apply M2_0123456789876543210Sym0 arg) (M2_0123456789876543210Sym1 arg) => - M2_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @b @(Maybe [a]) M2_0123456789876543210Sym0 a0123456789876543210 = M2_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings M2_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) M2_0123456789876543210Sym0KindInference ()) - type M2_0123456789876543210Sym1 :: forall b a. b -> Maybe [a] - type family M2_0123456789876543210Sym1 @b @a (a0123456789876543210 :: b) :: Maybe [a] where - M2_0123456789876543210Sym1 a0123456789876543210 = M2_0123456789876543210 a0123456789876543210 instance PC2 [a] where - type M2 a = Apply M2_0123456789876543210Sym0 a + type M2 a = M2_0123456789876543210 a type M2_0123456789876543210 :: forall b a. b -> Maybe (Maybe a) type family M2_0123456789876543210 @b @a (a :: b) :: Maybe (Maybe a) where M2_0123456789876543210 @b @a (_ :: b) = NothingSym0 :: Maybe (Maybe a) - type M2_0123456789876543210Sym0 :: forall b - a. (~>) b (Maybe (Maybe a)) - data M2_0123456789876543210Sym0 :: (~>) b (Maybe (Maybe a)) - where - M2_0123456789876543210Sym0KindInference :: SameKind (Apply M2_0123456789876543210Sym0 arg) (M2_0123456789876543210Sym1 arg) => - M2_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @b @(Maybe (Maybe a)) M2_0123456789876543210Sym0 a0123456789876543210 = M2_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings M2_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) M2_0123456789876543210Sym0KindInference ()) - type M2_0123456789876543210Sym1 :: forall b a. b -> Maybe (Maybe a) - type family M2_0123456789876543210Sym1 @b @a (a0123456789876543210 :: b) :: Maybe (Maybe a) where - M2_0123456789876543210Sym1 a0123456789876543210 = M2_0123456789876543210 a0123456789876543210 instance PC2 (Maybe a) where - type M2 a = Apply M2_0123456789876543210Sym0 a + type M2 a = M2_0123456789876543210 a type family Lambda_0123456789876543210 a0123456789876543210 x0123456789876543210 y0123456789876543210 xx where Lambda_0123456789876543210 a x y xx = xx :: a data Lambda_0123456789876543210Sym0 a0123456789876543210 x0123456789876543210 y0123456789876543210 xx0123456789876543210 @@ -241,37 +147,8 @@ Singletons/T581.hs:(0,0)-(0,0): Splicing declarations type family M3_0123456789876543210 @a @b (a :: Maybe a) (a :: b) :: (Maybe a, b) where M3_0123456789876543210 @a @b (x :: Maybe a) (y :: b) = Apply (Apply Tuple2Sym0 (Apply (Apply FmapSym0 (Lambda_0123456789876543210Sym0 a x y)) x)) y - type M3_0123456789876543210Sym0 :: forall a - b. (~>) (Maybe a) ((~>) b (Maybe a, b)) - data M3_0123456789876543210Sym0 :: (~>) (Maybe a) ((~>) b (Maybe a, - b)) - where - M3_0123456789876543210Sym0KindInference :: SameKind (Apply M3_0123456789876543210Sym0 arg) (M3_0123456789876543210Sym1 arg) => - M3_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @(Maybe a) @((~>) b (Maybe a, - b)) M3_0123456789876543210Sym0 a0123456789876543210 = M3_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings M3_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) M3_0123456789876543210Sym0KindInference ()) - type M3_0123456789876543210Sym1 :: forall a b. Maybe a - -> (~>) b (Maybe a, b) - data M3_0123456789876543210Sym1 (a0123456789876543210 :: Maybe a) :: (~>) b (Maybe a, - b) - where - M3_0123456789876543210Sym1KindInference :: SameKind (Apply (M3_0123456789876543210Sym1 a0123456789876543210) arg) (M3_0123456789876543210Sym2 a0123456789876543210 arg) => - M3_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @b @(Maybe a, - b) (M3_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = M3_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (M3_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) M3_0123456789876543210Sym1KindInference ()) - type M3_0123456789876543210Sym2 :: forall a b. Maybe a - -> b -> (Maybe a, b) - type family M3_0123456789876543210Sym2 @a @b (a0123456789876543210 :: Maybe a) (a0123456789876543210 :: b) :: (Maybe a, - b) where - M3_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = M3_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PC3 (Maybe a) where - type M3 a a = Apply (Apply M3_0123456789876543210Sym0 a) a + type M3 a a = M3_0123456789876543210 a a type family Lambda_0123456789876543210 a0123456789876543210 x0123456789876543210 y0123456789876543210 xx where Lambda_0123456789876543210 a x y xx = xx :: a data Lambda_0123456789876543210Sym0 a0123456789876543210 x0123456789876543210 y0123456789876543210 xx0123456789876543210 @@ -288,41 +165,14 @@ Singletons/T581.hs:(0,0)-(0,0): Splicing declarations type family M3_0123456789876543210 @a @b (a :: [a]) (a :: b) :: ([a], b) where M3_0123456789876543210 @a @b (x :: [a]) (y :: b) = Apply (Apply Tuple2Sym0 (Apply (Apply FmapSym0 (Lambda_0123456789876543210Sym0 a x y)) x)) y - type M3_0123456789876543210Sym0 :: forall a - b. (~>) [a] ((~>) b ([a], b)) - data M3_0123456789876543210Sym0 :: (~>) [a] ((~>) b ([a], b)) - where - M3_0123456789876543210Sym0KindInference :: SameKind (Apply M3_0123456789876543210Sym0 arg) (M3_0123456789876543210Sym1 arg) => - M3_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @[a] @((~>) b ([a], - b)) M3_0123456789876543210Sym0 a0123456789876543210 = M3_0123456789876543210Sym1 a0123456789876543210 - instance SuppressUnusedWarnings M3_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) M3_0123456789876543210Sym0KindInference ()) - type M3_0123456789876543210Sym1 :: forall a b. [a] - -> (~>) b ([a], b) - data M3_0123456789876543210Sym1 (a0123456789876543210 :: [a]) :: (~>) b ([a], - b) - where - M3_0123456789876543210Sym1KindInference :: SameKind (Apply (M3_0123456789876543210Sym1 a0123456789876543210) arg) (M3_0123456789876543210Sym2 a0123456789876543210 arg) => - M3_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210 - type instance Apply @b @([a], - b) (M3_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = M3_0123456789876543210 a0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings (M3_0123456789876543210Sym1 a0123456789876543210) where - suppressUnusedWarnings - = snd ((,) M3_0123456789876543210Sym1KindInference ()) - type M3_0123456789876543210Sym2 :: forall a b. [a] -> b -> ([a], b) - type family M3_0123456789876543210Sym2 @a @b (a0123456789876543210 :: [a]) (a0123456789876543210 :: b) :: ([a], - b) where - M3_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 = M3_0123456789876543210 a0123456789876543210 a0123456789876543210 instance PC3 [a] where - type M3 a a = Apply (Apply M3_0123456789876543210Sym0 a) a + type M3 a a = M3_0123456789876543210 a a class SC1 a where sM1 :: forall b (t :: a). Sing t -> Sing (Apply M1Sym0 t :: Maybe (a, b)) default sM1 :: - forall b (t :: a). ((Apply M1Sym0 t :: Maybe (a, b)) - ~ Apply M1_0123456789876543210Sym0 t) => + forall b (t :: a). ((M1 t :: Maybe (a, b)) + ~ M1_0123456789876543210 t) => Sing t -> Sing (Apply M1Sym0 t :: Maybe (a, b)) sM1 _ = SNothing :: Sing (NothingSym0 :: Maybe (a, b)) class SC2 a where @@ -331,8 +181,7 @@ Singletons/T581.hs:(0,0)-(0,0): Splicing declarations Sing t -> Sing (Apply M2Sym0 t :: Maybe a) :: Type) default sM2 :: (forall (t :: b). - ((Apply M2Sym0 t :: Maybe a) - ~ Apply M2_0123456789876543210Sym0 t) => + ((M2 t :: Maybe a) ~ M2_0123456789876543210 t) => Sing t -> Sing (Apply M2Sym0 t :: Maybe a) :: Type) sM2 _ = SNothing :: Sing (NothingSym0 :: Maybe a) class SC3 a where @@ -340,8 +189,8 @@ Singletons/T581.hs:(0,0)-(0,0): Splicing declarations forall b (t :: a) (t :: b). Sing t -> Sing t -> Sing (Apply (Apply M3Sym0 t) t :: (a, b)) default sM3 :: - forall b (t :: a) (t :: b). ((Apply (Apply M3Sym0 t) t :: (a, b)) - ~ Apply (Apply M3_0123456789876543210Sym0 t) t) => + forall b (t :: a) (t :: b). ((M3 t t :: (a, b)) + ~ M3_0123456789876543210 t t) => Sing t -> Sing t -> Sing (Apply (Apply M3Sym0 t) t :: (a, b)) sM3 (sX :: Sing x) (sY :: Sing y) diff --git a/singletons-base/tests/compile-and-dump/Singletons/T89.golden b/singletons-base/tests/compile-and-dump/Singletons/T89.golden index bf46a853..a2097f46 100644 --- a/singletons-base/tests/compile-and-dump/Singletons/T89.golden +++ b/singletons-base/tests/compile-and-dump/Singletons/T89.golden @@ -16,38 +16,12 @@ Singletons/T89.hs:0:0:: Splicing declarations type ToEnum_0123456789876543210 :: GHC.Num.Natural.Natural -> Foo type family ToEnum_0123456789876543210 (a :: GHC.Num.Natural.Natural) :: Foo where ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0)) - type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural Foo - data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Num.Natural.Natural Foo - where - ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) => - ToEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @GHC.Num.Natural.Natural @Foo ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) ToEnum_0123456789876543210Sym0KindInference ()) - type ToEnum_0123456789876543210Sym1 :: GHC.Num.Natural.Natural - -> Foo - type family ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Num.Natural.Natural) :: Foo where - ToEnum_0123456789876543210Sym1 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210 type FromEnum_0123456789876543210 :: Foo -> GHC.Num.Natural.Natural type family FromEnum_0123456789876543210 (a :: Foo) :: GHC.Num.Natural.Natural where FromEnum_0123456789876543210 Foo = FromInteger 0 - type FromEnum_0123456789876543210Sym0 :: (~>) Foo GHC.Num.Natural.Natural - data FromEnum_0123456789876543210Sym0 :: (~>) Foo GHC.Num.Natural.Natural - where - FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) => - FromEnum_0123456789876543210Sym0 a0123456789876543210 - type instance Apply @Foo @GHC.Num.Natural.Natural FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 - instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where - suppressUnusedWarnings - = snd ((,) FromEnum_0123456789876543210Sym0KindInference ()) - type FromEnum_0123456789876543210Sym1 :: Foo - -> GHC.Num.Natural.Natural - type family FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: Foo) :: GHC.Num.Natural.Natural where - FromEnum_0123456789876543210Sym1 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210 instance PEnum Foo where - type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a - type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a + type ToEnum a = ToEnum_0123456789876543210 a + type FromEnum a = FromEnum_0123456789876543210 a data SFoo :: Foo -> Type where SFoo :: SFoo (Foo :: Foo) type instance Sing @Foo = SFoo instance SingKind Foo where diff --git a/singletons-th/src/Data/Singletons/TH/Promote.hs b/singletons-th/src/Data/Singletons/TH/Promote.hs index 6ec9bb22..99f54b31 100644 --- a/singletons-th/src/Data/Singletons/TH/Promote.hs +++ b/singletons-th/src/Data/Singletons/TH/Promote.hs @@ -647,8 +647,14 @@ promoteMethod meth_sort orig_sigs_map cls_tvb_names (meth_name, meth_rhs) = do = OSet.empty meth_arg_tvs <- replicateM (length meth_arg_kis) (qNewName "a") let proName = promotedTopLevelValueName opts meth_name + -- The name of the "helper" type family which defines the promoted version + -- of a class method default or instance method. If the method's name is + -- alphanumeric, we reuse the method's name for the helper type family's + -- name. Otherwise, we use the name "TFHelper". (Note that + -- promoteLetDecRHS expects a value-level name, so we pass it "tFHelper", + -- which later gets promoted to TFHelper.) helperNameBase = case nameBase proName of - first:_ | not (isHsLetter first) -> "TFHelper" + first:_ | not (isHsLetter first) -> "tFHelper" alpha -> alpha -- family_args are the type variables in a promoted class's @@ -665,18 +671,23 @@ promoteMethod meth_sort orig_sigs_map cls_tvb_names (meth_name, meth_rhs) = do -- strictly necessary, as kind inference can figure them out just as well. family_args = map DVarT meth_arg_tvs helperName <- newUniqueName helperNameBase - let helperDefunName = defunctionalizedName0 opts helperName - (pro_decs, defun_decs, ann_rhs) + let helperTy = DConT $ promotedValueName opts helperName Nothing + + -- Promote the right-hand side of the helper. Note that we never partially + -- apply the helper type family, and users will never invoke the helper + -- directly. As such, there is no need to emit defunctionalization symbols for + -- the helper type family. + (pro_decs, _defun_decs, ann_rhs) <- promoteLetDecRHS (ClassMethodRHS meth_scoped_tvs meth_arg_kis meth_res_ki) OMap.empty OMap.empty Nothing helperName meth_rhs - emitDecs (pro_decs ++ defun_decs) + emitDecs pro_decs return ( DTySynInstD (DTySynEqn Nothing (foldType (DConT proName) family_args) - (foldApply (DConT helperDefunName) (map DVarT meth_arg_tvs))) + (foldType helperTy family_args)) , ann_rhs - , DConT helperDefunName ) + , helperTy ) where -- Promote the type of a class method. For a default method, "the type" is -- simply the type of the original method. For an instance method, diff --git a/singletons-th/src/Data/Singletons/TH/Single.hs b/singletons-th/src/Data/Singletons/TH/Single.hs index f1cc9b85..9e35ac7f 100644 --- a/singletons-th/src/Data/Singletons/TH/Single.hs +++ b/singletons-th/src/Data/Singletons/TH/Single.hs @@ -446,13 +446,13 @@ singClassD (ClassDecl { cd_cxt = cls_cxt -- Which applies Bar/BarDefault to b, which shouldn't happen. let tvs = map tvbToType $ filter (\tvb -> extractTvbName tvb `Set.member` bound_kv_set) tvbs - prom_meth = DConT $ defunctionalizedName0 opts meth_name + prom_meth = DConT $ promotedValueName opts meth_name Nothing default_pred = foldType (DConT equalityName) -- NB: Need the res_ki here to prevent ambiguous -- kinds in result-inferred default methods. -- See #175 - [ foldApply prom_meth tvs `DSigT` res_ki - , foldApply prom_dflt tvs ] + [ foldType prom_meth tvs `DSigT` res_ki + , foldType prom_dflt tvs ] return $ ravelVanillaDType tvbs (default_pred : cxt) args res where bound_kv_set = Set.fromList bound_kvs