singletons-base-3.3: A promoted and singled version of the base library
Copyright(C) 2021 Ryan Scott
LicenseBSD-style (see LICENSE)
MaintainerRichard Eisenberg (rae@cs.brynmawr.edu)
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageGHC2021

Data.Functor.Sum.Singletons

Description

Exports the promoted and singled versions of the Sum data type.

Synopsis

The Product singleton

type family Sing :: k -> Type #

Instances

Instances details
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SAll
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SAny
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SVoid
type Sing Source # 
Instance details

Defined in GHC.TypeLits.Singletons.Internal

type Sing = SNat
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing Source # 
Instance details

Defined in Data.Singletons.Base.TypeError

type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple0
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SBool
type Sing Source # 
Instance details

Defined in GHC.TypeLits.Singletons.Internal

type Sing = SChar
type Sing Source # 
Instance details

Defined in GHC.TypeLits.Singletons.Internal

type Sing = SSymbol
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SIdentity :: Identity a -> Type
type Sing Source # 
Instance details

Defined in Data.Monoid.Singletons

type Sing = SFirst :: First a -> Type
type Sing Source # 
Instance details

Defined in Data.Monoid.Singletons

type Sing = SLast :: Last a -> Type
type Sing Source # 
Instance details

Defined in Data.Ord.Singletons

type Sing = SDown :: Down a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SFirst :: First a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SLast :: Last a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SMax :: Max a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SMin :: Min a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SDual :: Dual a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SProduct :: Product a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SSum :: Sum a -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SNonEmpty :: NonEmpty a -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SMaybe :: Maybe a -> Type
type Sing Source #

A choice of singleton for the kind TYPE rep (for some RuntimeRep rep), an instantiation of which is the famous kind Type.

Conceivably, one could generalize this instance to `Sing @k` for any kind k, and remove all other Sing instances. We don't adopt this design, however, since it is far more convenient in practice to work with explicit singleton values than TypeReps (for instance, TypeReps are more difficult to pattern match on, and require extra runtime checks).

We cannot produce explicit singleton values for everything in TYPE rep, however, since it is an open kind, so we reach for TypeRep in this one particular case.

Instance details

Defined in Data.Singletons.Base.TypeRepTYPE

type Sing = TypeRep :: TYPE rep -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SList :: [a] -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SEither :: Either a b -> Type
type Sing Source # 
Instance details

Defined in Data.Proxy.Singletons

type Sing = SProxy :: Proxy t -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons

type Sing = SArg :: Arg a b -> Type
type Sing 
Instance details

Defined in Data.Singletons

type Sing 
Instance details

Defined in Data.Singletons

type Sing = SLambda :: (k1 ~> k2) -> Type
type Sing 
Instance details

Defined in Data.Singletons.Sigma

type Sing = SSigma :: Sigma s t -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple2 :: (a, b) -> Type
type Sing Source # 
Instance details

Defined in Data.Functor.Const.Singletons

type Sing = SConst :: Const a b -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple3 :: (a, b, c) -> Type
type Sing Source # 
Instance details

Defined in Data.Functor.Product.Singletons

type Sing = SProduct :: Product f g a -> Type
type Sing Source # 
Instance details

Defined in Data.Functor.Sum.Singletons

type Sing = SSum :: Sum f g a -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple4 :: (a, b, c, d) -> Type
type Sing Source # 
Instance details

Defined in Data.Functor.Compose.Singletons

type Sing = SCompose :: Compose f g a -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple5 :: (a, b, c, d, e) -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple6 :: (a, b, c, d, e, f) -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple7 :: (a, b, c, d, e, f, g) -> Type

data SSum (a1 :: Sum f g a) where Source #

Constructors

SInL :: forall {k} (f :: k -> Type) (g :: k -> Type) (a :: k) (x :: f a). Sing x -> SSum ('InL x :: Sum f g a) 
SInR :: forall {k} (f :: k -> Type) (g :: k -> Type) (a :: k) (y :: g a). Sing y -> SSum ('InR y :: Sum f g a) 

Instances

Instances details
(SDecide (f a), SDecide (g a)) => TestCoercion (SSum :: Sum f g a -> Type) Source # 
Instance details

Defined in Data.Functor.Sum.Singletons

Methods

testCoercion :: forall (a0 :: Sum f g a) (b :: Sum f g a). SSum a0 -> SSum b -> Maybe (Coercion a0 b) #

(SDecide (f a), SDecide (g a)) => TestEquality (SSum :: Sum f g a -> Type) Source # 
Instance details

Defined in Data.Functor.Sum.Singletons

Methods

testEquality :: forall (a0 :: Sum f g a) (b :: Sum f g a). SSum a0 -> SSum b -> Maybe (a0 :~: b) #

Eq (SSum z) Source # 
Instance details

Defined in Data.Functor.Sum.Singletons

Methods

(==) :: SSum z -> SSum z -> Bool #

(/=) :: SSum z -> SSum z -> Bool #

Ord (SSum z) Source # 
Instance details

Defined in Data.Functor.Sum.Singletons

Methods

compare :: SSum z -> SSum z -> Ordering #

(<) :: SSum z -> SSum z -> Bool #

(<=) :: SSum z -> SSum z -> Bool #

(>) :: SSum z -> SSum z -> Bool #

(>=) :: SSum z -> SSum z -> Bool #

max :: SSum z -> SSum z -> SSum z #

min :: SSum z -> SSum z -> SSum z #

Defunctionalization symbols

data InLSym0 (z :: TyFun (f a) (Sum f g a)) Source #

Instances

Instances details
SingI (InLSym0 :: TyFun (f a) (Sum f g a) -> Type) Source # 
Instance details

Defined in Data.Functor.Sum.Singletons

Methods

sing :: Sing (InLSym0 :: TyFun (f a) (Sum f g a) -> Type) #

type Apply (InLSym0 :: TyFun (f a) (Sum f g a) -> Type) (x :: f a) Source # 
Instance details

Defined in Data.Functor.Sum.Singletons

type Apply (InLSym0 :: TyFun (f a) (Sum f g a) -> Type) (x :: f a) = 'InL x :: Sum f g a

type family InLSym1 (x :: f a) :: Sum f g a where ... Source #

Equations

InLSym1 (x :: f a) = 'InL x :: Sum f g a 

data InRSym0 (z :: TyFun (g a) (Sum f g a)) Source #

Instances

Instances details
SingI (InRSym0 :: TyFun (g a) (Sum f g a) -> Type) Source # 
Instance details

Defined in Data.Functor.Sum.Singletons

Methods

sing :: Sing (InRSym0 :: TyFun (g a) (Sum f g a) -> Type) #

type Apply (InRSym0 :: TyFun (g a) (Sum f g a) -> Type) (y :: g a) Source # 
Instance details

Defined in Data.Functor.Sum.Singletons

type Apply (InRSym0 :: TyFun (g a) (Sum f g a) -> Type) (y :: g a) = 'InR y :: Sum f g a

type family InRSym1 (x :: g a) :: Sum f g a where ... Source #

Equations

InRSym1 (y :: g a) = 'InR y :: Sum f g a 

Orphan instances

SingI1 ('InL :: f a -> Sum f g a) Source # 
Instance details

Methods

liftSing :: forall (x :: f a). Sing x -> Sing ('InL x :: Sum f g a) #

SingI1 ('InR :: g a -> Sum f g a) Source # 
Instance details

Methods

liftSing :: forall (x :: g a). Sing x -> Sing ('InR x :: Sum f g a) #

PFunctor (Sum f g) Source # 
Instance details

(SFunctor f, SFunctor g) => SFunctor (Sum f g) Source # 
Instance details

Methods

sFmap :: forall a b (t1 :: a ~> b) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply (FmapSym0 :: TyFun (a ~> b) (Sum f g a ~> Sum f g b) -> Type) t1) t2) Source #

(%<$) :: forall a b (t1 :: a) (t2 :: Sum f g b). Sing t1 -> Sing t2 -> Sing (Apply (Apply ((<$@#@$) :: TyFun a (Sum f g b ~> Sum f g a) -> Type) t1) t2) Source #

PFoldable (Sum f g) Source # 
Instance details

(SFoldable f, SFoldable g) => SFoldable (Sum f g) Source # 
Instance details

Methods

sFold :: forall m (t1 :: Sum f g m). SMonoid m => Sing t1 -> Sing (Apply (FoldSym0 :: TyFun (Sum f g m) m -> Type) t1) Source #

sFoldMap :: forall a m (t1 :: a ~> m) (t2 :: Sum f g a). SMonoid m => Sing t1 -> Sing t2 -> Sing (Apply (Apply (FoldMapSym0 :: TyFun (a ~> m) (Sum f g a ~> m) -> Type) t1) t2) Source #

sFoldr :: forall a b (t1 :: a ~> (b ~> b)) (t2 :: b) (t3 :: Sum f g a). Sing t1 -> Sing t2 -> Sing t3 -> Sing (Apply (Apply (Apply (FoldrSym0 :: TyFun (a ~> (b ~> b)) (b ~> (Sum f g a ~> b)) -> Type) t1) t2) t3) Source #

sFoldr' :: forall a b (t1 :: a ~> (b ~> b)) (t2 :: b) (t3 :: Sum f g a). Sing t1 -> Sing t2 -> Sing t3 -> Sing (Apply (Apply (Apply (Foldr'Sym0 :: TyFun (a ~> (b ~> b)) (b ~> (Sum f g a ~> b)) -> Type) t1) t2) t3) Source #

sFoldl :: forall b a (t1 :: b ~> (a ~> b)) (t2 :: b) (t3 :: Sum f g a). Sing t1 -> Sing t2 -> Sing t3 -> Sing (Apply (Apply (Apply (FoldlSym0 :: TyFun (b ~> (a ~> b)) (b ~> (Sum f g a ~> b)) -> Type) t1) t2) t3) Source #

sFoldl' :: forall b a (t1 :: b ~> (a ~> b)) (t2 :: b) (t3 :: Sum f g a). Sing t1 -> Sing t2 -> Sing t3 -> Sing (Apply (Apply (Apply (Foldl'Sym0 :: TyFun (b ~> (a ~> b)) (b ~> (Sum f g a ~> b)) -> Type) t1) t2) t3) Source #

sFoldr1 :: forall a (t1 :: a ~> (a ~> a)) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply (Foldr1Sym0 :: TyFun (a ~> (a ~> a)) (Sum f g a ~> a) -> Type) t1) t2) Source #

sFoldl1 :: forall a (t1 :: a ~> (a ~> a)) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply (Foldl1Sym0 :: TyFun (a ~> (a ~> a)) (Sum f g a ~> a) -> Type) t1) t2) Source #

sToList :: forall a (t1 :: Sum f g a). Sing t1 -> Sing (Apply (ToListSym0 :: TyFun (Sum f g a) [a] -> Type) t1) Source #

sNull :: forall a (t1 :: Sum f g a). Sing t1 -> Sing (Apply (NullSym0 :: TyFun (Sum f g a) Bool -> Type) t1) Source #

sLength :: forall a (t1 :: Sum f g a). Sing t1 -> Sing (Apply (LengthSym0 :: TyFun (Sum f g a) Natural -> Type) t1) Source #

sElem :: forall a (t1 :: a) (t2 :: Sum f g a). SEq a => Sing t1 -> Sing t2 -> Sing (Apply (Apply (ElemSym0 :: TyFun a (Sum f g a ~> Bool) -> Type) t1) t2) Source #

sMaximum :: forall a (t1 :: Sum f g a). SOrd a => Sing t1 -> Sing (Apply (MaximumSym0 :: TyFun (Sum f g a) a -> Type) t1) Source #

sMinimum :: forall a (t1 :: Sum f g a). SOrd a => Sing t1 -> Sing (Apply (MinimumSym0 :: TyFun (Sum f g a) a -> Type) t1) Source #

sSum :: forall a (t1 :: Sum f g a). SNum a => Sing t1 -> Sing (Apply (SumSym0 :: TyFun (Sum f g a) a -> Type) t1) Source #

sProduct :: forall a (t1 :: Sum f g a). SNum a => Sing t1 -> Sing (Apply (ProductSym0 :: TyFun (Sum f g a) a -> Type) t1) Source #

PTraversable (Sum f g) Source # 
Instance details

(STraversable f, STraversable g) => STraversable (Sum f g) Source # 
Instance details

Methods

sTraverse :: forall a (f0 :: Type -> Type) b (t1 :: a ~> f0 b) (t2 :: Sum f g a). SApplicative f0 => Sing t1 -> Sing t2 -> Sing (Apply (Apply (TraverseSym0 :: TyFun (a ~> f b) (Sum f g a ~> f (Sum f g b)) -> Type) t1) t2) Source #

sSequenceA :: forall (f0 :: Type -> Type) a (t1 :: Sum f g (f0 a)). SApplicative f0 => Sing t1 -> Sing (Apply (SequenceASym0 :: TyFun (Sum f g (f a)) (f (Sum f g a)) -> Type) t1) Source #

sMapM :: forall a (m :: Type -> Type) b (t1 :: a ~> m b) (t2 :: Sum f g a). SMonad m => Sing t1 -> Sing t2 -> Sing (Apply (Apply (MapMSym0 :: TyFun (a ~> m b) (Sum f g a ~> m (Sum f g b)) -> Type) t1) t2) Source #

sSequence :: forall (m :: Type -> Type) a (t1 :: Sum f g (m a)). SMonad m => Sing t1 -> Sing (Apply (SequenceSym0 :: TyFun (Sum f g (m a)) (m (Sum f g a)) -> Type) t1) Source #

(SDecide (f a), SDecide (g a)) => SDecide (Sum f g a) Source # 
Instance details

Methods

(%~) :: forall (a0 :: Sum f g a) (b :: Sum f g a). Sing a0 -> Sing b -> Decision (a0 :~: b) #

PEq (Sum f g a) Source # 
Instance details

(SEq (f a), SEq (g a)) => SEq (Sum f g a) Source # 
Instance details

Methods

(%==) :: forall (t1 :: Sum f g a) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply ((==@#@$) :: TyFun (Sum f g a) (Sum f g a ~> Bool) -> Type) t1) t2) Source #

(%/=) :: forall (t1 :: Sum f g a) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply ((/=@#@$) :: TyFun (Sum f g a) (Sum f g a ~> Bool) -> Type) t1) t2) Source #

POrd (Sum f g a) Source # 
Instance details

(SOrd (f a), SOrd (g a)) => SOrd (Sum f g a) Source # 
Instance details

Methods

sCompare :: forall (t1 :: Sum f g a) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply (CompareSym0 :: TyFun (Sum f g a) (Sum f g a ~> Ordering) -> Type) t1) t2) Source #

(%<) :: forall (t1 :: Sum f g a) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply ((<@#@$) :: TyFun (Sum f g a) (Sum f g a ~> Bool) -> Type) t1) t2) Source #

(%<=) :: forall (t1 :: Sum f g a) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply ((<=@#@$) :: TyFun (Sum f g a) (Sum f g a ~> Bool) -> Type) t1) t2) Source #

(%>) :: forall (t1 :: Sum f g a) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply ((>@#@$) :: TyFun (Sum f g a) (Sum f g a ~> Bool) -> Type) t1) t2) Source #

(%>=) :: forall (t1 :: Sum f g a) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply ((>=@#@$) :: TyFun (Sum f g a) (Sum f g a ~> Bool) -> Type) t1) t2) Source #

sMax :: forall (t1 :: Sum f g a) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply (MaxSym0 :: TyFun (Sum f g a) (Sum f g a ~> Sum f g a) -> Type) t1) t2) Source #

sMin :: forall (t1 :: Sum f g a) (t2 :: Sum f g a). Sing t1 -> Sing t2 -> Sing (Apply (Apply (MinSym0 :: TyFun (Sum f g a) (Sum f g a ~> Sum f g a) -> Type) t1) t2) Source #

SingI x => SingI ('InL x :: Sum f g a) Source # 
Instance details

Methods

sing :: Sing ('InL x :: Sum f g a) #

SingI y => SingI ('InR y :: Sum f g a) Source # 
Instance details

Methods

sing :: Sing ('InR y :: Sum f g a) #