packages feed

singletons-base-3.0: tests/compile-and-dump/Singletons/T176.golden

Singletons/T176.hs:(0,0)-(0,0): Splicing declarations
    singletons
      [d| quux1 :: Foo1 a => a -> a
          quux1 x = x `bar1` \ _ -> baz1
          quux2 :: Foo2 a => a -> a
          quux2 x = x `bar2` baz2
          
          class Foo1 a where
            bar1 :: a -> (a -> b) -> b
            baz1 :: a
          class Foo2 a where
            bar2 :: a -> b -> b
            baz2 :: a |]
  ======>
    class Foo1 a where
      bar1 :: a -> (a -> b) -> b
      baz1 :: a
    quux1 :: Foo1 a => a -> a
    quux1 x = (x `bar1` (\ _ -> baz1))
    class Foo2 a where
      bar2 :: a -> b -> b
      baz2 :: a
    quux2 :: Foo2 a => a -> a
    quux2 x = (x `bar2` baz2)
    type family Case_0123456789876543210 arg_0123456789876543210 x t where
      Case_0123456789876543210 arg_0123456789876543210 x _ = Baz1Sym0
    type family Lambda_0123456789876543210 x arg_0123456789876543210 where
      Lambda_0123456789876543210 x arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x arg_0123456789876543210
    data Lambda_0123456789876543210Sym0 x0123456789876543210
      where
        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
      suppressUnusedWarnings
        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
    data Lambda_0123456789876543210Sym1 x0123456789876543210 arg_01234567898765432100123456789876543210
      where
        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 arg_01234567898765432100123456789876543210
    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 arg_01234567898765432100123456789876543210
    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
      suppressUnusedWarnings
        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
    type family Lambda_0123456789876543210Sym2 x0123456789876543210 arg_01234567898765432100123456789876543210 where
      Lambda_0123456789876543210Sym2 x0123456789876543210 arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 arg_01234567898765432100123456789876543210
    type Quux2Sym0 :: (~>) a a
    data Quux2Sym0 :: (~>) a a
      where
        Quux2Sym0KindInference :: SameKind (Apply Quux2Sym0 arg) (Quux2Sym1 arg) =>
                                  Quux2Sym0 a0123456789876543210
    type instance Apply Quux2Sym0 a0123456789876543210 = Quux2 a0123456789876543210
    instance SuppressUnusedWarnings Quux2Sym0 where
      suppressUnusedWarnings = snd (((,) Quux2Sym0KindInference) ())
    type Quux2Sym1 :: a -> a
    type family Quux2Sym1 (a0123456789876543210 :: a) :: a where
      Quux2Sym1 a0123456789876543210 = Quux2 a0123456789876543210
    type Quux1Sym0 :: (~>) a a
    data Quux1Sym0 :: (~>) a a
      where
        Quux1Sym0KindInference :: SameKind (Apply Quux1Sym0 arg) (Quux1Sym1 arg) =>
                                  Quux1Sym0 a0123456789876543210
    type instance Apply Quux1Sym0 a0123456789876543210 = Quux1 a0123456789876543210
    instance SuppressUnusedWarnings Quux1Sym0 where
      suppressUnusedWarnings = snd (((,) Quux1Sym0KindInference) ())
    type Quux1Sym1 :: a -> a
    type family Quux1Sym1 (a0123456789876543210 :: a) :: a where
      Quux1Sym1 a0123456789876543210 = Quux1 a0123456789876543210
    type Quux2 :: a -> a
    type family Quux2 (a :: a) :: a where
      Quux2 x = Apply (Apply Bar2Sym0 x) Baz2Sym0
    type Quux1 :: a -> a
    type family Quux1 (a :: a) :: a where
      Quux1 x = Apply (Apply Bar1Sym0 x) (Apply Lambda_0123456789876543210Sym0 x)
    type Bar1Sym0 :: forall a b. (~>) a ((~>) ((~>) a b) b)
    data Bar1Sym0 :: (~>) a ((~>) ((~>) a b) b)
      where
        Bar1Sym0KindInference :: SameKind (Apply Bar1Sym0 arg) (Bar1Sym1 arg) =>
                                 Bar1Sym0 a0123456789876543210
    type instance Apply Bar1Sym0 a0123456789876543210 = Bar1Sym1 a0123456789876543210
    instance SuppressUnusedWarnings Bar1Sym0 where
      suppressUnusedWarnings = snd (((,) Bar1Sym0KindInference) ())
    type Bar1Sym1 :: forall a b. a -> (~>) ((~>) a b) b
    data Bar1Sym1 (a0123456789876543210 :: a) :: (~>) ((~>) a b) b
      where
        Bar1Sym1KindInference :: SameKind (Apply (Bar1Sym1 a0123456789876543210) arg) (Bar1Sym2 a0123456789876543210 arg) =>
                                 Bar1Sym1 a0123456789876543210 a0123456789876543210
    type instance Apply (Bar1Sym1 a0123456789876543210) a0123456789876543210 = Bar1 a0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings (Bar1Sym1 a0123456789876543210) where
      suppressUnusedWarnings = snd (((,) Bar1Sym1KindInference) ())
    type Bar1Sym2 :: forall a b. a -> (~>) a b -> b
    type family Bar1Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: (~>) a b) :: b where
      Bar1Sym2 a0123456789876543210 a0123456789876543210 = Bar1 a0123456789876543210 a0123456789876543210
    type Baz1Sym0 :: forall a. a
    type family Baz1Sym0 :: a where
      Baz1Sym0 = Baz1
    class PFoo1 a where
      type Bar1 (arg :: a) (arg :: (~>) a b) :: b
      type Baz1 :: a
    type Bar2Sym0 :: forall a b. (~>) a ((~>) b b)
    data Bar2Sym0 :: (~>) a ((~>) b b)
      where
        Bar2Sym0KindInference :: SameKind (Apply Bar2Sym0 arg) (Bar2Sym1 arg) =>
                                 Bar2Sym0 a0123456789876543210
    type instance Apply Bar2Sym0 a0123456789876543210 = Bar2Sym1 a0123456789876543210
    instance SuppressUnusedWarnings Bar2Sym0 where
      suppressUnusedWarnings = snd (((,) Bar2Sym0KindInference) ())
    type Bar2Sym1 :: forall a b. a -> (~>) b b
    data Bar2Sym1 (a0123456789876543210 :: a) :: (~>) b b
      where
        Bar2Sym1KindInference :: SameKind (Apply (Bar2Sym1 a0123456789876543210) arg) (Bar2Sym2 a0123456789876543210 arg) =>
                                 Bar2Sym1 a0123456789876543210 a0123456789876543210
    type instance Apply (Bar2Sym1 a0123456789876543210) a0123456789876543210 = Bar2 a0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings (Bar2Sym1 a0123456789876543210) where
      suppressUnusedWarnings = snd (((,) Bar2Sym1KindInference) ())
    type Bar2Sym2 :: forall a b. a -> b -> b
    type family Bar2Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) :: b where
      Bar2Sym2 a0123456789876543210 a0123456789876543210 = Bar2 a0123456789876543210 a0123456789876543210
    type Baz2Sym0 :: forall a. a
    type family Baz2Sym0 :: a where
      Baz2Sym0 = Baz2
    class PFoo2 a where
      type Bar2 (arg :: a) (arg :: b) :: b
      type Baz2 :: a
    sQuux2 ::
      forall a (t :: a).
      SFoo2 a => Sing t -> Sing (Apply Quux2Sym0 t :: a)
    sQuux1 ::
      forall a (t :: a).
      SFoo1 a => Sing t -> Sing (Apply Quux1Sym0 t :: a)
    sQuux2 (sX :: Sing x)
      = (applySing ((applySing ((singFun2 @Bar2Sym0) sBar2)) sX)) sBaz2
    sQuux1 (sX :: Sing x)
      = (applySing ((applySing ((singFun2 @Bar1Sym0) sBar1)) sX))
          ((singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
             (\ sArg_0123456789876543210
                -> case sArg_0123456789876543210 of {
                     (_ :: Sing arg_0123456789876543210)
                       -> (id
                             @(Sing (Case_0123456789876543210 arg_0123456789876543210 x arg_0123456789876543210)))
                            (case sArg_0123456789876543210 of { _ -> sBaz1 }) }))
    instance SFoo2 a => SingI (Quux2Sym0 :: (~>) a a) where
      sing = (singFun1 @Quux2Sym0) sQuux2
    instance SFoo1 a => SingI (Quux1Sym0 :: (~>) a a) where
      sing = (singFun1 @Quux1Sym0) sQuux1
    class SFoo1 a where
      sBar1 ::
        forall b (t :: a) (t :: (~>) a b).
        Sing t -> Sing t -> Sing (Apply (Apply Bar1Sym0 t) t :: b)
      sBaz1 :: Sing (Baz1Sym0 :: a)
    class SFoo2 a where
      sBar2 ::
        forall b (t :: a) (t :: b).
        Sing t -> Sing t -> Sing (Apply (Apply Bar2Sym0 t) t :: b)
      sBaz2 :: Sing (Baz2Sym0 :: a)
    instance SFoo1 a =>
             SingI (Bar1Sym0 :: (~>) a ((~>) ((~>) a b) b)) where
      sing = (singFun2 @Bar1Sym0) sBar1
    instance (SFoo1 a, SingI d) =>
             SingI (Bar1Sym1 (d :: a) :: (~>) ((~>) a b) b) where
      sing = (singFun1 @(Bar1Sym1 (d :: a))) (sBar1 (sing @d))
    instance SFoo2 a => SingI (Bar2Sym0 :: (~>) a ((~>) b b)) where
      sing = (singFun2 @Bar2Sym0) sBar2
    instance (SFoo2 a, SingI d) =>
             SingI (Bar2Sym1 (d :: a) :: (~>) b b) where
      sing = (singFun1 @(Bar2Sym1 (d :: a))) (sBar2 (sing @d))