Singletons/CaseExpressions.hs:(0,0)-(0,0): Splicing declarations singletons [d| foo1 :: a -> Maybe a -> a foo1 d x = case x of Just y -> y Nothing -> d foo2 :: a -> Maybe a -> a foo2 d _ = case (Just d) of { Just y -> y } foo3 :: a -> b -> a foo3 a b = case (a, b) of { (p, _) -> p } foo4 :: forall a. a -> a foo4 x = case x of { y -> let z :: a z = y in z } foo5 :: a -> a foo5 x = case x of { y -> (\ _ -> x) y } |] ======> foo1 :: a -> Maybe a -> a foo1 d x = case x of Just y -> y Nothing -> d foo2 :: a -> Maybe a -> a foo2 d _ = case Just d of { Just y -> y } foo3 :: a -> b -> a foo3 a b = case (a, b) of { (p, _) -> p } foo4 :: forall a. a -> a foo4 x = case x of { y -> let z :: a z = y in z } foo5 :: a -> a foo5 x = case x of { y -> (\ _ -> x) y } type family Case_0123456789876543210 x y arg_0123456789876543210 t where Case_0123456789876543210 x y arg_0123456789876543210 _ = x type family Lambda_0123456789876543210 x y t where Lambda_0123456789876543210 x y arg_0123456789876543210 = Case_0123456789876543210 x y arg_0123456789876543210 arg_0123456789876543210 type Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 t0123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 t0123456789876543210 instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) where suppressUnusedWarnings = snd (((,) Lambda_0123456789876543210Sym2KindInference) ()) data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 t0123456789876543210 where Lambda_0123456789876543210Sym2KindInference :: forall x0123456789876543210 y0123456789876543210 t0123456789876543210 arg. SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) => Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 t0123456789876543210 type instance Apply (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 y0123456789876543210 x0123456789876543210 t0123456789876543210 instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where suppressUnusedWarnings = snd (((,) Lambda_0123456789876543210Sym1KindInference) ()) data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210 where Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210 y0123456789876543210 arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) => Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210 type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where suppressUnusedWarnings = snd (((,) Lambda_0123456789876543210Sym0KindInference) ()) data Lambda_0123456789876543210Sym0 x0123456789876543210 where Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210 arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) => Lambda_0123456789876543210Sym0 x0123456789876543210 type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210 type family Case_0123456789876543210 x t where Case_0123456789876543210 x y = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) y type Let0123456789876543210ZSym2 x0123456789876543210 y0123456789876543210 = Let0123456789876543210Z x0123456789876543210 y0123456789876543210 instance SuppressUnusedWarnings (Let0123456789876543210ZSym1 x0123456789876543210) where suppressUnusedWarnings = snd (((,) Let0123456789876543210ZSym1KindInference) ()) data Let0123456789876543210ZSym1 x0123456789876543210 y0123456789876543210 where Let0123456789876543210ZSym1KindInference :: forall x0123456789876543210 y0123456789876543210 arg. SameKind (Apply (Let0123456789876543210ZSym1 x0123456789876543210) arg) (Let0123456789876543210ZSym2 x0123456789876543210 arg) => Let0123456789876543210ZSym1 x0123456789876543210 y0123456789876543210 type instance Apply (Let0123456789876543210ZSym1 x0123456789876543210) y0123456789876543210 = Let0123456789876543210Z x0123456789876543210 y0123456789876543210 instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where suppressUnusedWarnings = snd (((,) Let0123456789876543210ZSym0KindInference) ()) data Let0123456789876543210ZSym0 x0123456789876543210 where Let0123456789876543210ZSym0KindInference :: forall x0123456789876543210 arg. SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) => Let0123456789876543210ZSym0 x0123456789876543210 type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210ZSym1 x0123456789876543210 type family Let0123456789876543210Z x y :: a where Let0123456789876543210Z x y = y type family Case_0123456789876543210 x t where Case_0123456789876543210 x y = Let0123456789876543210ZSym2 x y type Let0123456789876543210Scrutinee_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 a0123456789876543210 b0123456789876543210 instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210) where suppressUnusedWarnings = snd (((,) Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference) ()) data Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210 where Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference :: forall a0123456789876543210 b0123456789876543210 arg. SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a0123456789876543210 arg) => Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210 type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210) b0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 a0123456789876543210 b0123456789876543210 instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where suppressUnusedWarnings = snd (((,) Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference) ()) data Let0123456789876543210Scrutinee_0123456789876543210Sym0 a0123456789876543210 where Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: forall a0123456789876543210 arg. SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) => Let0123456789876543210Scrutinee_0123456789876543210Sym0 a0123456789876543210 type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 a0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210 type family Let0123456789876543210Scrutinee_0123456789876543210 a b where Let0123456789876543210Scrutinee_0123456789876543210 a b = Apply (Apply Tuple2Sym0 a) b type family Case_0123456789876543210 a b t where Case_0123456789876543210 a b '(p, _) = p type Let0123456789876543210Scrutinee_0123456789876543210Sym1 d0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 d0123456789876543210 instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where suppressUnusedWarnings = snd (((,) Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference) ()) data Let0123456789876543210Scrutinee_0123456789876543210Sym0 d0123456789876543210 where Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: forall d0123456789876543210 arg. SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) => Let0123456789876543210Scrutinee_0123456789876543210Sym0 d0123456789876543210 type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 d0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 d0123456789876543210 type family Let0123456789876543210Scrutinee_0123456789876543210 d where Let0123456789876543210Scrutinee_0123456789876543210 d = Apply JustSym0 d type family Case_0123456789876543210 d t where Case_0123456789876543210 d ( 'Just y) = y type family Case_0123456789876543210 d x t where Case_0123456789876543210 d x ( 'Just y) = y Case_0123456789876543210 d x 'Nothing = d type Foo5Sym1 (a0123456789876543210 :: a0123456789876543210) = Foo5 a0123456789876543210 instance SuppressUnusedWarnings Foo5Sym0 where suppressUnusedWarnings = snd (((,) Foo5Sym0KindInference) ()) data Foo5Sym0 :: forall a0123456789876543210. (~>) a0123456789876543210 a0123456789876543210 where Foo5Sym0KindInference :: forall a0123456789876543210 arg. SameKind (Apply Foo5Sym0 arg) (Foo5Sym1 arg) => Foo5Sym0 a0123456789876543210 type instance Apply Foo5Sym0 a0123456789876543210 = Foo5 a0123456789876543210 type Foo4Sym1 (a0123456789876543210 :: a0123456789876543210) = Foo4 a0123456789876543210 instance SuppressUnusedWarnings Foo4Sym0 where suppressUnusedWarnings = snd (((,) Foo4Sym0KindInference) ()) data Foo4Sym0 :: forall a0123456789876543210. (~>) a0123456789876543210 a0123456789876543210 where Foo4Sym0KindInference :: forall a0123456789876543210 arg. SameKind (Apply Foo4Sym0 arg) (Foo4Sym1 arg) => Foo4Sym0 a0123456789876543210 type instance Apply Foo4Sym0 a0123456789876543210 = Foo4 a0123456789876543210 type Foo3Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) = Foo3 a0123456789876543210 a0123456789876543210 instance SuppressUnusedWarnings (Foo3Sym1 a0123456789876543210) where suppressUnusedWarnings = snd (((,) Foo3Sym1KindInference) ()) data Foo3Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210. (~>) b0123456789876543210 a0123456789876543210 where Foo3Sym1KindInference :: forall a0123456789876543210 a0123456789876543210 arg. SameKind (Apply (Foo3Sym1 a0123456789876543210) arg) (Foo3Sym2 a0123456789876543210 arg) => Foo3Sym1 a0123456789876543210 a0123456789876543210 type instance Apply (Foo3Sym1 a0123456789876543210) a0123456789876543210 = Foo3 a0123456789876543210 a0123456789876543210 instance SuppressUnusedWarnings Foo3Sym0 where suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ()) data Foo3Sym0 :: forall a0123456789876543210 b0123456789876543210. (~>) a0123456789876543210 ((~>) b0123456789876543210 a0123456789876543210) where Foo3Sym0KindInference :: forall a0123456789876543210 arg. SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) => Foo3Sym0 a0123456789876543210 type instance Apply Foo3Sym0 a0123456789876543210 = Foo3Sym1 a0123456789876543210 type Foo2Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: Maybe a0123456789876543210) = Foo2 a0123456789876543210 a0123456789876543210 instance SuppressUnusedWarnings (Foo2Sym1 a0123456789876543210) where suppressUnusedWarnings = snd (((,) Foo2Sym1KindInference) ()) data Foo2Sym1 (a0123456789876543210 :: a0123456789876543210) :: (~>) (Maybe a0123456789876543210) a0123456789876543210 where Foo2Sym1KindInference :: forall a0123456789876543210 a0123456789876543210 arg. SameKind (Apply (Foo2Sym1 a0123456789876543210) arg) (Foo2Sym2 a0123456789876543210 arg) => Foo2Sym1 a0123456789876543210 a0123456789876543210 type instance Apply (Foo2Sym1 a0123456789876543210) a0123456789876543210 = Foo2 a0123456789876543210 a0123456789876543210 instance SuppressUnusedWarnings Foo2Sym0 where suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ()) data Foo2Sym0 :: forall a0123456789876543210. (~>) a0123456789876543210 ((~>) (Maybe a0123456789876543210) a0123456789876543210) where Foo2Sym0KindInference :: forall a0123456789876543210 arg. SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) => Foo2Sym0 a0123456789876543210 type instance Apply Foo2Sym0 a0123456789876543210 = Foo2Sym1 a0123456789876543210 type Foo1Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: Maybe a0123456789876543210) = Foo1 a0123456789876543210 a0123456789876543210 instance SuppressUnusedWarnings (Foo1Sym1 a0123456789876543210) where suppressUnusedWarnings = snd (((,) Foo1Sym1KindInference) ()) data Foo1Sym1 (a0123456789876543210 :: a0123456789876543210) :: (~>) (Maybe a0123456789876543210) a0123456789876543210 where Foo1Sym1KindInference :: forall a0123456789876543210 a0123456789876543210 arg. SameKind (Apply (Foo1Sym1 a0123456789876543210) arg) (Foo1Sym2 a0123456789876543210 arg) => Foo1Sym1 a0123456789876543210 a0123456789876543210 type instance Apply (Foo1Sym1 a0123456789876543210) a0123456789876543210 = Foo1 a0123456789876543210 a0123456789876543210 instance SuppressUnusedWarnings Foo1Sym0 where suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ()) data Foo1Sym0 :: forall a0123456789876543210. (~>) a0123456789876543210 ((~>) (Maybe a0123456789876543210) a0123456789876543210) where Foo1Sym0KindInference :: forall a0123456789876543210 arg. SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) => Foo1Sym0 a0123456789876543210 type instance Apply Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210 type family Foo5 (a :: a) :: a where Foo5 x = Case_0123456789876543210 x x type family Foo4 (a :: a) :: a where Foo4 x = Case_0123456789876543210 x x type family Foo3 (a :: a) (a :: b) :: a where Foo3 a b = Case_0123456789876543210 a b (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a b) type family Foo2 (a :: a) (a :: Maybe a) :: a where Foo2 d _ = Case_0123456789876543210 d (Let0123456789876543210Scrutinee_0123456789876543210Sym1 d) type family Foo1 (a :: a) (a :: Maybe a) :: a where Foo1 d x = Case_0123456789876543210 d x x sFoo5 :: forall a (t :: a). Sing t -> Sing (Apply Foo5Sym0 t :: a) sFoo4 :: forall a (t :: a). Sing t -> Sing (Apply Foo4Sym0 t :: a) sFoo3 :: forall a b (t :: a) (t :: b). Sing t -> Sing t -> Sing (Apply (Apply Foo3Sym0 t) t :: a) sFoo2 :: forall a (t :: a) (t :: Maybe a). Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t :: a) sFoo1 :: forall a (t :: a) (t :: Maybe a). Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t :: a) sFoo5 (sX :: Sing x) = (case sX of { (sY :: Sing y) -> (applySing ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 x) y)) (\ sArg_0123456789876543210 -> case sArg_0123456789876543210 of { (_ :: Sing arg_0123456789876543210) -> (case sArg_0123456789876543210 of { _ -> sX }) :: Sing (Case_0123456789876543210 x y arg_0123456789876543210 arg_0123456789876543210) }))) sY }) :: Sing (Case_0123456789876543210 x x :: a) sFoo4 (sX :: Sing x) = (case sX of { (sY :: Sing y) -> let sZ :: Sing (Let0123456789876543210ZSym2 x y :: a) sZ = sY in sZ }) :: Sing (Case_0123456789876543210 x x :: a) sFoo3 (sA :: Sing a) (sB :: Sing b) = let sScrutinee_0123456789876543210 :: Sing (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a b) sScrutinee_0123456789876543210 = (applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sA)) sB in (case sScrutinee_0123456789876543210 of { STuple2 (sP :: Sing p) _ -> sP }) :: Sing (Case_0123456789876543210 a b (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a b) :: a) sFoo2 (sD :: Sing d) _ = let sScrutinee_0123456789876543210 :: Sing (Let0123456789876543210Scrutinee_0123456789876543210Sym1 d) sScrutinee_0123456789876543210 = (applySing ((singFun1 @JustSym0) SJust)) sD in (case sScrutinee_0123456789876543210 of { SJust (sY :: Sing y) -> sY }) :: Sing (Case_0123456789876543210 d (Let0123456789876543210Scrutinee_0123456789876543210Sym1 d) :: a) sFoo1 (sD :: Sing d) (sX :: Sing x) = (case sX of SJust (sY :: Sing y) -> sY SNothing -> sD) :: Sing (Case_0123456789876543210 d x x :: a) instance SingI (Foo5Sym0 :: (~>) a a) where sing = (singFun1 @Foo5Sym0) sFoo5 instance SingI (Foo4Sym0 :: (~>) a a) where sing = (singFun1 @Foo4Sym0) sFoo4 instance SingI (Foo3Sym0 :: (~>) a ((~>) b a)) where sing = (singFun2 @Foo3Sym0) sFoo3 instance SingI d => SingI (Foo3Sym1 (d :: a) :: (~>) b a) where sing = (singFun1 @(Foo3Sym1 (d :: a))) (sFoo3 (sing @d)) instance SingI (Foo2Sym0 :: (~>) a ((~>) (Maybe a) a)) where sing = (singFun2 @Foo2Sym0) sFoo2 instance SingI d => SingI (Foo2Sym1 (d :: a) :: (~>) (Maybe a) a) where sing = (singFun1 @(Foo2Sym1 (d :: a))) (sFoo2 (sing @d)) instance SingI (Foo1Sym0 :: (~>) a ((~>) (Maybe a) a)) where sing = (singFun2 @Foo1Sym0) sFoo1 instance SingI d => SingI (Foo1Sym1 (d :: a) :: (~>) (Maybe a) a) where sing = (singFun1 @(Foo1Sym1 (d :: a))) (sFoo1 (sing @d))