packages feed

singletons-base-3.5: tests/compile-and-dump/Singletons/LambdaCase.golden

Singletons/LambdaCase.hs:(0,0)-(0,0): Splicing declarations
    singletons
      [d| foo1 :: a -> Maybe a -> a
          foo1 d x
            = (\case
                 Just y -> y
                 Nothing -> d)
                x
          foo2 :: a -> Maybe a -> a
          foo2 d _
            = (\case
                 Just y -> y
                 Nothing -> d)
                (Just d)
          foo3 :: a -> b -> a
          foo3 a b = (\case (p, _) -> p) (a, b) |]
  ======>
    foo1 :: a -> Maybe a -> a
    foo1 d x
      = (\case
           Just y -> y
           Nothing -> d)
          x
    foo2 :: a -> Maybe a -> a
    foo2 d _
      = (\case
           Just y -> y
           Nothing -> d)
          (Just d)
    foo3 :: a -> b -> a
    foo3 a b = (\case (p, _) -> p) (a, b)
    type family LamCases_0123456789876543210 (a0123456789876543210 :: a0123456789876543210) (b0123456789876543210 :: b0123456789876543210) a_0123456789876543210 where
      LamCases_0123456789876543210 a b '(p, _) = p
    data LamCases_0123456789876543210Sym0 (a0123456789876543210 :: a0123456789876543210) (b0123456789876543210 :: b0123456789876543210) a_01234567898765432100123456789876543210
      where
        LamCases_0123456789876543210Sym0KindInference :: SameKind (Apply (LamCases_0123456789876543210Sym0 a0123456789876543210 b0123456789876543210) arg) (LamCases_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210 arg) =>
                                                         LamCases_0123456789876543210Sym0 a0123456789876543210 b0123456789876543210 a_01234567898765432100123456789876543210
    type instance Apply @_ @_ (LamCases_0123456789876543210Sym0 a0123456789876543210 b0123456789876543210) a_01234567898765432100123456789876543210 = LamCases_0123456789876543210 a0123456789876543210 b0123456789876543210 a_01234567898765432100123456789876543210
    instance SuppressUnusedWarnings (LamCases_0123456789876543210Sym0 a0123456789876543210 b0123456789876543210) where
      suppressUnusedWarnings
        = snd ((,) LamCases_0123456789876543210Sym0KindInference ())
    type family LamCases_0123456789876543210Sym1 (a0123456789876543210 :: a0123456789876543210) (b0123456789876543210 :: b0123456789876543210) a_01234567898765432100123456789876543210 where
      LamCases_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210 a_01234567898765432100123456789876543210 = LamCases_0123456789876543210 a0123456789876543210 b0123456789876543210 a_01234567898765432100123456789876543210
    type family LamCases_0123456789876543210 (d0123456789876543210 :: a0123456789876543210) a_0123456789876543210 where
      LamCases_0123456789876543210 d ('Just y) = y
      LamCases_0123456789876543210 d 'Nothing = d
    data LamCases_0123456789876543210Sym0 (d0123456789876543210 :: a0123456789876543210) a_01234567898765432100123456789876543210
      where
        LamCases_0123456789876543210Sym0KindInference :: SameKind (Apply (LamCases_0123456789876543210Sym0 d0123456789876543210) arg) (LamCases_0123456789876543210Sym1 d0123456789876543210 arg) =>
                                                         LamCases_0123456789876543210Sym0 d0123456789876543210 a_01234567898765432100123456789876543210
    type instance Apply @_ @_ (LamCases_0123456789876543210Sym0 d0123456789876543210) a_01234567898765432100123456789876543210 = LamCases_0123456789876543210 d0123456789876543210 a_01234567898765432100123456789876543210
    instance SuppressUnusedWarnings (LamCases_0123456789876543210Sym0 d0123456789876543210) where
      suppressUnusedWarnings
        = snd ((,) LamCases_0123456789876543210Sym0KindInference ())
    type family LamCases_0123456789876543210Sym1 (d0123456789876543210 :: a0123456789876543210) a_01234567898765432100123456789876543210 where
      LamCases_0123456789876543210Sym1 d0123456789876543210 a_01234567898765432100123456789876543210 = LamCases_0123456789876543210 d0123456789876543210 a_01234567898765432100123456789876543210
    type family LamCases_0123456789876543210 (d0123456789876543210 :: a0123456789876543210) (x0123456789876543210 :: Maybe a0123456789876543210) a_0123456789876543210 where
      LamCases_0123456789876543210 d x ('Just y) = y
      LamCases_0123456789876543210 d x 'Nothing = d
    data LamCases_0123456789876543210Sym0 (d0123456789876543210 :: a0123456789876543210) (x0123456789876543210 :: Maybe a0123456789876543210) a_01234567898765432100123456789876543210
      where
        LamCases_0123456789876543210Sym0KindInference :: SameKind (Apply (LamCases_0123456789876543210Sym0 d0123456789876543210 x0123456789876543210) arg) (LamCases_0123456789876543210Sym1 d0123456789876543210 x0123456789876543210 arg) =>
                                                         LamCases_0123456789876543210Sym0 d0123456789876543210 x0123456789876543210 a_01234567898765432100123456789876543210
    type instance Apply @_ @_ (LamCases_0123456789876543210Sym0 d0123456789876543210 x0123456789876543210) a_01234567898765432100123456789876543210 = LamCases_0123456789876543210 d0123456789876543210 x0123456789876543210 a_01234567898765432100123456789876543210
    instance SuppressUnusedWarnings (LamCases_0123456789876543210Sym0 d0123456789876543210 x0123456789876543210) where
      suppressUnusedWarnings
        = snd ((,) LamCases_0123456789876543210Sym0KindInference ())
    type family LamCases_0123456789876543210Sym1 (d0123456789876543210 :: a0123456789876543210) (x0123456789876543210 :: Maybe a0123456789876543210) a_01234567898765432100123456789876543210 where
      LamCases_0123456789876543210Sym1 d0123456789876543210 x0123456789876543210 a_01234567898765432100123456789876543210 = LamCases_0123456789876543210 d0123456789876543210 x0123456789876543210 a_01234567898765432100123456789876543210
    type Foo3Sym0 :: (~>) a ((~>) b a)
    data Foo3Sym0 :: (~>) a ((~>) b a)
      where
        Foo3Sym0KindInference :: SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
                                 Foo3Sym0 a0123456789876543210
    type instance Apply @a @((~>) b a) Foo3Sym0 a0123456789876543210 = Foo3Sym1 a0123456789876543210
    instance SuppressUnusedWarnings Foo3Sym0 where
      suppressUnusedWarnings = snd ((,) Foo3Sym0KindInference ())
    type Foo3Sym1 :: a -> (~>) b a
    data Foo3Sym1 (a0123456789876543210 :: a) :: (~>) b a
      where
        Foo3Sym1KindInference :: SameKind (Apply (Foo3Sym1 a0123456789876543210) arg) (Foo3Sym2 a0123456789876543210 arg) =>
                                 Foo3Sym1 a0123456789876543210 a0123456789876543210
    type instance Apply @b @a (Foo3Sym1 a0123456789876543210) a0123456789876543210 = Foo3 a0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings (Foo3Sym1 a0123456789876543210) where
      suppressUnusedWarnings = snd ((,) Foo3Sym1KindInference ())
    type Foo3Sym2 :: a -> b -> a
    type family Foo3Sym2 @a @b (a0123456789876543210 :: a) (a0123456789876543210 :: b) :: a where
      Foo3Sym2 a0123456789876543210 a0123456789876543210 = Foo3 a0123456789876543210 a0123456789876543210
    type Foo2Sym0 :: (~>) a ((~>) (Maybe a) a)
    data Foo2Sym0 :: (~>) a ((~>) (Maybe a) a)
      where
        Foo2Sym0KindInference :: SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
                                 Foo2Sym0 a0123456789876543210
    type instance Apply @a @((~>) (Maybe a) a) Foo2Sym0 a0123456789876543210 = Foo2Sym1 a0123456789876543210
    instance SuppressUnusedWarnings Foo2Sym0 where
      suppressUnusedWarnings = snd ((,) Foo2Sym0KindInference ())
    type Foo2Sym1 :: a -> (~>) (Maybe a) a
    data Foo2Sym1 (a0123456789876543210 :: a) :: (~>) (Maybe a) a
      where
        Foo2Sym1KindInference :: SameKind (Apply (Foo2Sym1 a0123456789876543210) arg) (Foo2Sym2 a0123456789876543210 arg) =>
                                 Foo2Sym1 a0123456789876543210 a0123456789876543210
    type instance Apply @(Maybe a) @a (Foo2Sym1 a0123456789876543210) a0123456789876543210 = Foo2 a0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings (Foo2Sym1 a0123456789876543210) where
      suppressUnusedWarnings = snd ((,) Foo2Sym1KindInference ())
    type Foo2Sym2 :: a -> Maybe a -> a
    type family Foo2Sym2 @a (a0123456789876543210 :: a) (a0123456789876543210 :: Maybe a) :: a where
      Foo2Sym2 a0123456789876543210 a0123456789876543210 = Foo2 a0123456789876543210 a0123456789876543210
    type Foo1Sym0 :: (~>) a ((~>) (Maybe a) a)
    data Foo1Sym0 :: (~>) a ((~>) (Maybe a) a)
      where
        Foo1Sym0KindInference :: SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
                                 Foo1Sym0 a0123456789876543210
    type instance Apply @a @((~>) (Maybe a) a) Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210
    instance SuppressUnusedWarnings Foo1Sym0 where
      suppressUnusedWarnings = snd ((,) Foo1Sym0KindInference ())
    type Foo1Sym1 :: a -> (~>) (Maybe a) a
    data Foo1Sym1 (a0123456789876543210 :: a) :: (~>) (Maybe a) a
      where
        Foo1Sym1KindInference :: SameKind (Apply (Foo1Sym1 a0123456789876543210) arg) (Foo1Sym2 a0123456789876543210 arg) =>
                                 Foo1Sym1 a0123456789876543210 a0123456789876543210
    type instance Apply @(Maybe a) @a (Foo1Sym1 a0123456789876543210) a0123456789876543210 = Foo1 a0123456789876543210 a0123456789876543210
    instance SuppressUnusedWarnings (Foo1Sym1 a0123456789876543210) where
      suppressUnusedWarnings = snd ((,) Foo1Sym1KindInference ())
    type Foo1Sym2 :: a -> Maybe a -> a
    type family Foo1Sym2 @a (a0123456789876543210 :: a) (a0123456789876543210 :: Maybe a) :: a where
      Foo1Sym2 a0123456789876543210 a0123456789876543210 = Foo1 a0123456789876543210 a0123456789876543210
    type Foo3 :: a -> b -> a
    type family Foo3 @a @b (a :: a) (a :: b) :: a where
      Foo3 a b = Apply (LamCases_0123456789876543210Sym0 a b) (Apply (Apply Tuple2Sym0 a) b)
    type Foo2 :: a -> Maybe a -> a
    type family Foo2 @a (a :: a) (a :: Maybe a) :: a where
      Foo2 d _ = Apply (LamCases_0123456789876543210Sym0 d) (Apply JustSym0 d)
    type Foo1 :: a -> Maybe a -> a
    type family Foo1 @a (a :: a) (a :: Maybe a) :: a where
      Foo1 d x = Apply (LamCases_0123456789876543210Sym0 d x) x
    sFoo3 ::
      (forall (t :: a) (t :: b).
       Sing t -> Sing t -> Sing (Foo3 t t :: a) :: Type)
    sFoo2 ::
      (forall (t :: a) (t :: Maybe a).
       Sing t -> Sing t -> Sing (Foo2 t t :: a) :: Type)
    sFoo1 ::
      (forall (t :: a) (t :: Maybe a).
       Sing t -> Sing t -> Sing (Foo1 t t :: a) :: Type)
    sFoo3 (sA :: Sing a) (sB :: Sing b)
      = applySing
          (singFun1
             @(LamCases_0123456789876543210Sym0 a b)
             (\cases (STuple2 (sP :: Sing p) _) -> sP))
          (applySing (applySing (singFun2 @Tuple2Sym0 STuple2) sA) sB)
    sFoo2 (sD :: Sing d) _
      = applySing
          (singFun1
             @(LamCases_0123456789876543210Sym0 d)
             (\cases
                (SJust (sY :: Sing y)) -> sY
                SNothing -> sD))
          (applySing (singFun1 @JustSym0 SJust) sD)
    sFoo1 (sD :: Sing d) (sX :: Sing x)
      = applySing
          (singFun1
             @(LamCases_0123456789876543210Sym0 d x)
             (\cases
                (SJust (sY :: Sing y)) -> sY
                SNothing -> sD))
          sX
    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 SingI1 (Foo3Sym1 :: a -> (~>) b a) where
      liftSing (s :: Sing (d :: a))
        = singFun1 @(Foo3Sym1 (d :: a)) (sFoo3 s)
    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 SingI1 (Foo2Sym1 :: a -> (~>) (Maybe a) a) where
      liftSing (s :: Sing (d :: a))
        = singFun1 @(Foo2Sym1 (d :: a)) (sFoo2 s)
    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))
    instance SingI1 (Foo1Sym1 :: a -> (~>) (Maybe a) a) where
      liftSing (s :: Sing (d :: a))
        = singFun1 @(Foo1Sym1 (d :: a)) (sFoo1 s)