{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Data.Functor.Compose.Singletons (
Sing, SCompose(..), GetCompose, sGetCompose,
ComposeSym0, ComposeSym1,
GetComposeSym0, GetComposeSym1
) where
import Control.Applicative
import Control.Applicative.Singletons
import Data.Foldable.Singletons
import Data.Functor.Compose
import Data.Functor.Singletons
import Data.Kind
import Data.Singletons
import Data.Singletons.TH
import Data.Traversable.Singletons
infixr 9 `SCompose`
type SCompose :: Compose f g a -> Type
data SCompose :: Compose f g a -> Type where
SCompose :: forall f g a (x :: f (g a)).
Sing x -> SCompose ('Compose @f @g @a x)
type instance Sing = SCompose
instance SingI x => SingI ('Compose x) where
sing :: Sing ('Compose x)
sing = Sing x -> SCompose ('Compose x)
forall {k} {k1} (f :: k -> *) (g :: k1 -> k) (a :: k1)
(arg :: f (g a)).
Sing arg -> SCompose ('Compose arg)
SCompose Sing x
forall {k} (a :: k). SingI a => Sing a
sing
instance SingI1 'Compose where
liftSing :: forall (x :: f (g a)). Sing x -> Sing ('Compose x)
liftSing = Sing x -> Sing ('Compose x)
Sing x -> SCompose ('Compose x)
forall {k} {k1} (f :: k -> *) (g :: k1 -> k) (a :: k1)
(arg :: f (g a)).
Sing arg -> SCompose ('Compose arg)
SCompose
infixr 9 `ComposeSym0`
type ComposeSym0 :: f (g a) ~> Compose f g a
data ComposeSym0 z
type instance Apply ComposeSym0 x = 'Compose x
instance SingI ComposeSym0 where
sing :: Sing ComposeSym0
sing = SingFunction1 ComposeSym0 -> Sing ComposeSym0
forall {a1} {b} (f :: a1 ~> b). SingFunction1 f -> Sing f
singFun1 Sing t -> Sing (Apply ComposeSym0 t)
Sing t -> SCompose ('Compose t)
SingFunction1 ComposeSym0
forall {k} {k1} (f :: k -> *) (g :: k1 -> k) (a :: k1)
(arg :: f (g a)).
Sing arg -> SCompose ('Compose arg)
SCompose
infixr 9 `ComposeSym1`
type ComposeSym1 :: f (g a) -> Compose f g a
type family ComposeSym1 x where
ComposeSym1 x = 'Compose x
$