singletons-base
Copyright(C) 2013-2014 Richard Eisenberg Jan Stolarek
LicenseBSD-style (see LICENSE)
MaintainerRyan Scott
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageGHC2021

Data.Either.Singletons

Description

Defines functions and datatypes relating to the singleton for Either, including singled versions of all the definitions in Data.Either.

Because many of these definitions are produced by Template Haskell, it is not possible to create proper Haddock documentation. Please look up the corresponding operation in Data.Either. Also, please excuse the apparent repeated variable names. This is due to an interaction between Template Haskell and Haddock.

Synopsis

The Either singleton

type family Sing :: k -> Type #

Instances

Instances details
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SVoid
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 Source # 
Instance details

Defined in Data.Singletons.Base.TypeError

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 = 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.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.Singletons.Base.Instances

type Sing = SNonEmpty :: NonEmpty a -> Type
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 = 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 = 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.Semigroup.Singletons

type Sing = SArg :: Arg a b -> 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 # 
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 SEither (a1 :: Either a b) where Source #

Constructors

SLeft :: forall a b (n :: a). Sing n -> SEither ('Left n :: Either a b) 
SRight :: forall a b (n :: b). Sing n -> SEither ('Right n :: Either a b) 

Instances

Instances details
(SDecide a, SDecide b) => TestCoercion (SEither :: Either a b -> Type) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

Methods

testCoercion :: forall (a0 :: Either a b) (b0 :: Either a b). SEither a0 -> SEither b0 -> Maybe (Coercion a0 b0) #

(SDecide a, SDecide b) => TestEquality (SEither :: Either a b -> Type) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

Methods

testEquality :: forall (a0 :: Either a b) (b0 :: Either a b). SEither a0 -> SEither b0 -> Maybe (a0 :~: b0) #

(ShowSing a, ShowSing b) => Show (SEither z) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

Methods

showsPrec :: Int -> SEither z -> ShowS #

show :: SEither z -> String #

showList :: [SEither z] -> ShowS #

Eq (SEither z) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

Methods

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

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

Singletons from Data.Either

either_ :: (a -> c) -> (b -> c) -> Either a b -> c Source #

type family Either_ (a1 :: a ~> c) (a2 :: b ~> c) (a3 :: Either a b) :: c where ... Source #

Equations

Either_ (f :: k1 ~> k2) (_1 :: b ~> k2) ('Left x :: Either k1 b) = Apply f x 
Either_ (_1 :: a ~> k2) (g :: k1 ~> k2) ('Right y :: Either a k1) = Apply g y 

sEither_ :: forall a c b (t1 :: a ~> c) (t2 :: b ~> c) (t3 :: Either a b). Sing t1 -> Sing t2 -> Sing t3 -> Sing (Either_ t1 t2 t3) Source #

The preceding two definitions are derived from the function either in Data.Either. The extra underscore is to avoid name clashes with the type Either.

type family Lefts (a1 :: [Either a b]) :: [a] where ... Source #

Equations

Lefts ('[] :: [Either a b]) = NilSym0 :: [a] 
Lefts (('Left x :: Either a b) ': xs :: [Either a b]) = Apply (Apply ((:@#@$) :: TyFun a ([a] ~> [a]) -> Type) x) (Apply (LeftsSym0 :: TyFun [Either a b] [a] -> Type) xs) 
Lefts (('Right _1 :: Either a b) ': xs :: [Either a b]) = Apply (LeftsSym0 :: TyFun [Either a b] [a] -> Type) xs 

sLefts :: forall a b (t :: [Either a b]). Sing t -> Sing (Lefts t) Source #

type family Rights (a1 :: [Either a b]) :: [b] where ... Source #

Equations

Rights ('[] :: [Either a b]) = NilSym0 :: [b] 
Rights (('Left _1 :: Either a b) ': xs :: [Either a b]) = Apply (RightsSym0 :: TyFun [Either a b] [b] -> Type) xs 
Rights (('Right x :: Either a b) ': xs :: [Either a b]) = Apply (Apply ((:@#@$) :: TyFun b ([b] ~> [b]) -> Type) x) (Apply (RightsSym0 :: TyFun [Either a b] [b] -> Type) xs) 

sRights :: forall a b (t :: [Either a b]). Sing t -> Sing (Rights t) Source #

type family PartitionEithers (a1 :: [Either a b]) :: ([a], [b]) where ... Source #

Equations

PartitionEithers (a_6989586621679261596 :: [Either a b]) = Apply (Apply (Apply (FoldrSym0 :: TyFun (Either a b ~> (([a], [b]) ~> ([a], [b]))) (([a], [b]) ~> ([Either a b] ~> ([a], [b]))) -> Type) (Apply (Apply (Either_Sym0 :: TyFun (a ~> (TyFun ([a], [b]) ([a], [b]) -> Type)) ((b ~> (TyFun ([a], [b]) ([a], [b]) -> Type)) ~> (Either a b ~> (TyFun ([a], [b]) ([a], [b]) -> Type))) -> Type) (Let6989586621679261602LeftSym0 a_6989586621679261596 :: TyFun a (TyFun ([a], [b]) ([a], [b]) -> Type) -> Type)) (Let6989586621679261602RightSym0 a_6989586621679261596 :: TyFun b (TyFun ([a], [b]) ([a], [b]) -> Type) -> Type))) (Apply (Apply (Tuple2Sym0 :: TyFun [a] ([b] ~> ([a], [b])) -> Type) (NilSym0 :: [a])) (NilSym0 :: [b]))) a_6989586621679261596 

sPartitionEithers :: forall a b (t :: [Either a b]). Sing t -> Sing (PartitionEithers t) Source #

type family IsLeft (a1 :: Either a b) :: Bool where ... Source #

Equations

IsLeft ('Left _1 :: Either a b) = TrueSym0 
IsLeft ('Right _1 :: Either a b) = FalseSym0 

sIsLeft :: forall a b (t :: Either a b). Sing t -> Sing (IsLeft t) Source #

type family IsRight (a1 :: Either a b) :: Bool where ... Source #

Equations

IsRight ('Left _1 :: Either a b) = FalseSym0 
IsRight ('Right _1 :: Either a b) = TrueSym0 

sIsRight :: forall a b (t :: Either a b). Sing t -> Sing (IsRight t) Source #

Defunctionalization symbols

data LeftSym0 (a1 :: TyFun a (Either a b)) Source #

Instances

Instances details
SingI (LeftSym0 :: TyFun a (Either a b) -> Type) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

Methods

sing :: Sing (LeftSym0 :: TyFun a (Either a b) -> Type) #

SuppressUnusedWarnings (LeftSym0 :: TyFun a (Either a b) -> Type) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Apply (LeftSym0 :: TyFun a (Either a b) -> Type) (a6989586621679050337 :: a) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Apply (LeftSym0 :: TyFun a (Either a b) -> Type) (a6989586621679050337 :: a) = 'Left a6989586621679050337 :: Either a b

type family LeftSym1 (a6989586621679050337 :: a) :: Either a b where ... Source #

Equations

LeftSym1 (a6989586621679050337 :: a) = 'Left a6989586621679050337 :: Either a b 

data RightSym0 (a1 :: TyFun b (Either a b)) Source #

Instances

Instances details
SingI (RightSym0 :: TyFun b (Either a b) -> Type) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

Methods

sing :: Sing (RightSym0 :: TyFun b (Either a b) -> Type) #

SuppressUnusedWarnings (RightSym0 :: TyFun b (Either a b) -> Type) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Apply (RightSym0 :: TyFun b (Either a b) -> Type) (a6989586621679050339 :: b) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Apply (RightSym0 :: TyFun b (Either a b) -> Type) (a6989586621679050339 :: b) = 'Right a6989586621679050339 :: Either a b

type family RightSym1 (a6989586621679050339 :: b) :: Either a b where ... Source #

Equations

RightSym1 (a6989586621679050339 :: b) = 'Right a6989586621679050339 :: Either a b 

data Either_Sym0 (a1 :: TyFun (a ~> c) ((b ~> c) ~> (Either a b ~> c))) Source #

Instances

Instances details
SingI (Either_Sym0 :: TyFun (a ~> c) ((b ~> c) ~> (Either a b ~> c)) -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

Methods

sing :: Sing (Either_Sym0 :: TyFun (a ~> c) ((b ~> c) ~> (Either a b ~> c)) -> Type) #

SuppressUnusedWarnings (Either_Sym0 :: TyFun (a ~> c) ((b ~> c) ~> (Either a b ~> c)) -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (Either_Sym0 :: TyFun (a ~> c) ((b ~> c) ~> (Either a b ~> c)) -> Type) (a6989586621679259290 :: a ~> c) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (Either_Sym0 :: TyFun (a ~> c) ((b ~> c) ~> (Either a b ~> c)) -> Type) (a6989586621679259290 :: a ~> c) = Either_Sym1 a6989586621679259290 :: TyFun (b ~> c) (Either a b ~> c) -> Type

data Either_Sym1 (a6989586621679259290 :: a ~> c) (b1 :: TyFun (b ~> c) (Either a b ~> c)) Source #

Instances

Instances details
SingI1 (Either_Sym1 :: (a ~> c) -> TyFun (b ~> c) (Either a b ~> c) -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

Methods

liftSing :: forall (x :: a ~> c). Sing x -> Sing (Either_Sym1 x :: TyFun (b ~> c) (Either a b ~> c) -> Type) #

SingI d => SingI (Either_Sym1 d :: TyFun (b ~> c) (Either a b ~> c) -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

Methods

sing :: Sing (Either_Sym1 d :: TyFun (b ~> c) (Either a b ~> c) -> Type) #

SuppressUnusedWarnings (Either_Sym1 a6989586621679259290 :: TyFun (b ~> c) (Either a b ~> c) -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (Either_Sym1 a6989586621679259290 :: TyFun (b ~> c) (Either a b ~> c) -> Type) (a6989586621679259291 :: b ~> c) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (Either_Sym1 a6989586621679259290 :: TyFun (b ~> c) (Either a b ~> c) -> Type) (a6989586621679259291 :: b ~> c) = Either_Sym2 a6989586621679259290 a6989586621679259291

data Either_Sym2 (a6989586621679259290 :: a ~> c) (a6989586621679259291 :: b ~> c) (c1 :: TyFun (Either a b) c) Source #

Instances

Instances details
SingI2 (Either_Sym2 :: (a ~> c) -> (b ~> c) -> TyFun (Either a b) c -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

Methods

liftSing2 :: forall (x :: a ~> c) (y :: b ~> c). Sing x -> Sing y -> Sing (Either_Sym2 x y) #

SingI d => SingI1 (Either_Sym2 d :: (b ~> c) -> TyFun (Either a b) c -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

Methods

liftSing :: forall (x :: b ~> c). Sing x -> Sing (Either_Sym2 d x) #

(SingI d1, SingI d2) => SingI (Either_Sym2 d1 d2 :: TyFun (Either a b) c -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

Methods

sing :: Sing (Either_Sym2 d1 d2) #

SuppressUnusedWarnings (Either_Sym2 a6989586621679259290 a6989586621679259291 :: TyFun (Either a b) c -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (Either_Sym2 a6989586621679259290 a6989586621679259291 :: TyFun (Either a b) c -> Type) (a6989586621679259292 :: Either a b) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (Either_Sym2 a6989586621679259290 a6989586621679259291 :: TyFun (Either a b) c -> Type) (a6989586621679259292 :: Either a b) = Either_ a6989586621679259290 a6989586621679259291 a6989586621679259292

type family Either_Sym3 (a6989586621679259290 :: a ~> c) (a6989586621679259291 :: b ~> c) (a6989586621679259292 :: Either a b) :: c where ... Source #

Equations

Either_Sym3 (a6989586621679259290 :: a ~> c) (a6989586621679259291 :: b ~> c) (a6989586621679259292 :: Either a b) = Either_ a6989586621679259290 a6989586621679259291 a6989586621679259292 

data LeftsSym0 (a1 :: TyFun [Either a b] [a]) Source #

Instances

Instances details
SingI (LeftsSym0 :: TyFun [Either a b] [a] -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

Methods

sing :: Sing (LeftsSym0 :: TyFun [Either a b] [a] -> Type) #

SuppressUnusedWarnings (LeftsSym0 :: TyFun [Either a b] [a] -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (LeftsSym0 :: TyFun [Either a b] [a] -> Type) (a6989586621679261623 :: [Either a b]) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (LeftsSym0 :: TyFun [Either a b] [a] -> Type) (a6989586621679261623 :: [Either a b]) = Lefts a6989586621679261623

type family LeftsSym1 (a6989586621679261623 :: [Either a b]) :: [a] where ... Source #

Equations

LeftsSym1 (a6989586621679261623 :: [Either a b]) = Lefts a6989586621679261623 

data RightsSym0 (a1 :: TyFun [Either a b] [b]) Source #

Instances

Instances details
SingI (RightsSym0 :: TyFun [Either a b] [b] -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

Methods

sing :: Sing (RightsSym0 :: TyFun [Either a b] [b] -> Type) #

SuppressUnusedWarnings (RightsSym0 :: TyFun [Either a b] [b] -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (RightsSym0 :: TyFun [Either a b] [b] -> Type) (a6989586621679261617 :: [Either a b]) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (RightsSym0 :: TyFun [Either a b] [b] -> Type) (a6989586621679261617 :: [Either a b]) = Rights a6989586621679261617

type family RightsSym1 (a6989586621679261617 :: [Either a b]) :: [b] where ... Source #

Equations

RightsSym1 (a6989586621679261617 :: [Either a b]) = Rights a6989586621679261617 

data IsLeftSym0 (a1 :: TyFun (Either a b) Bool) Source #

Instances

Instances details
SingI (IsLeftSym0 :: TyFun (Either a b) Bool -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

Methods

sing :: Sing (IsLeftSym0 :: TyFun (Either a b) Bool -> Type) #

SuppressUnusedWarnings (IsLeftSym0 :: TyFun (Either a b) Bool -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (IsLeftSym0 :: TyFun (Either a b) Bool -> Type) (a6989586621679261595 :: Either a b) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (IsLeftSym0 :: TyFun (Either a b) Bool -> Type) (a6989586621679261595 :: Either a b) = IsLeft a6989586621679261595

type family IsLeftSym1 (a6989586621679261595 :: Either a b) :: Bool where ... Source #

Equations

IsLeftSym1 (a6989586621679261595 :: Either a b) = IsLeft a6989586621679261595 

data IsRightSym0 (a1 :: TyFun (Either a b) Bool) Source #

Instances

Instances details
SingI (IsRightSym0 :: TyFun (Either a b) Bool -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

Methods

sing :: Sing (IsRightSym0 :: TyFun (Either a b) Bool -> Type) #

SuppressUnusedWarnings (IsRightSym0 :: TyFun (Either a b) Bool -> Type) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (IsRightSym0 :: TyFun (Either a b) Bool -> Type) (a6989586621679261592 :: Either a b) Source # 
Instance details

Defined in Data.Either.Singletons

type Apply (IsRightSym0 :: TyFun (Either a b) Bool -> Type) (a6989586621679261592 :: Either a b) = IsRight a6989586621679261592

type family IsRightSym1 (a6989586621679261592 :: Either a b) :: Bool where ... Source #

Equations

IsRightSym1 (a6989586621679261592 :: Either a b) = IsRight a6989586621679261592