singletons-2.2: A framework for generating singleton types

Data.Promotion.Prelude.Either

Description

Defines promoted functions and datatypes relating to Either, including a promoted version 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

# Promoted functions from Data.Either

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

type family Either_ (a :: TyFun a c -> Type) (a :: TyFun b c -> Type) (a :: Either a b) :: c where ... Source #

Equations

 Either_ f _z_1627829204 (Left x) = Apply f x Either_ _z_1627829208 g (Right y) = Apply g y

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 (a :: [Either a b]) :: [a] where ... Source #

Equations

 Lefts '[] = '[] Lefts ((:) (Left x) xs) = Apply (Apply (:$) x) (Apply LeftsSym0 xs) Lefts ((:) (Right _z_1627830553) xs) = Apply LeftsSym0 xs type family Rights (a :: [Either a b]) :: [b] where ... Source # Equations  Rights '[] = '[] Rights ((:) (Left _z_1627830541) xs) = Apply RightsSym0 xs Rights ((:) (Right x) xs) = Apply (Apply (:$) x) (Apply RightsSym0 xs)

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

Equations

 PartitionEithers a_1627830495 = Apply (Apply (Apply FoldrSym0 (Apply (Apply Either_Sym0 (Let1627830502LeftSym1 a_1627830495)) (Let1627830502RightSym1 a_1627830495))) (Apply (Apply Tuple2Sym0 '[]) '[])) a_1627830495

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

Equations

 IsLeft (Left _z_1627830489) = TrueSym0 IsLeft (Right _z_1627830492) = FalseSym0

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

Equations

 IsRight (Left _z_1627830479) = FalseSym0 IsRight (Right _z_1627830482) = TrueSym0

# Defunctionalization symbols

data LeftSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun a1627437720 (Either a1627437720 b1627437721) -> *) (LeftSym0 a1627437720 b1627437721) Source # MethodssuppressUnusedWarnings :: Proxy (LeftSym0 a1627437720 b1627437721) t -> () Source # type Apply a1627437720 (Either a1627437720 b1627437721) (LeftSym0 a1627437720 b1627437721) l0 Source # type Apply a1627437720 (Either a1627437720 b1627437721) (LeftSym0 a1627437720 b1627437721) l0 = LeftSym1 a1627437720 b1627437721 l0

type LeftSym1 t = Left t Source #

data RightSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun b1627437721 (Either a1627437720 b1627437721) -> *) (RightSym0 a1627437720 b1627437721) Source # MethodssuppressUnusedWarnings :: Proxy (RightSym0 a1627437720 b1627437721) t -> () Source # type Apply b1627437721 (Either a1627437720 b1627437721) (RightSym0 a1627437720 b1627437721) l0 Source # type Apply b1627437721 (Either a1627437720 b1627437721) (RightSym0 a1627437720 b1627437721) l0 = RightSym1 b1627437721 a1627437720 l0

type RightSym1 t = Right t Source #

data Either_Sym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun (TyFun a1627829180 c1627829181 -> Type) (TyFun (TyFun b1627829182 c1627829181 -> Type) (TyFun (Either a1627829180 b1627829182) c1627829181 -> Type) -> Type) -> *) (Either_Sym0 a1627829180 b1627829182 c1627829181) Source # MethodssuppressUnusedWarnings :: Proxy (Either_Sym0 a1627829180 b1627829182 c1627829181) t -> () Source # type Apply (TyFun a1627829180 c1627829181 -> Type) (TyFun (TyFun b1627829182 c1627829181 -> Type) (TyFun (Either a1627829180 b1627829182) c1627829181 -> Type) -> Type) (Either_Sym0 a1627829180 b1627829182 c1627829181) l0 Source # type Apply (TyFun a1627829180 c1627829181 -> Type) (TyFun (TyFun b1627829182 c1627829181 -> Type) (TyFun (Either a1627829180 b1627829182) c1627829181 -> Type) -> Type) (Either_Sym0 a1627829180 b1627829182 c1627829181) l0 = Either_Sym1 b1627829182 a1627829180 c1627829181 l0

data Either_Sym1 l l Source #

Instances

 SuppressUnusedWarnings ((TyFun a1627829180 c1627829181 -> Type) -> TyFun (TyFun b1627829182 c1627829181 -> Type) (TyFun (Either a1627829180 b1627829182) c1627829181 -> Type) -> *) (Either_Sym1 b1627829182 a1627829180 c1627829181) Source # MethodssuppressUnusedWarnings :: Proxy (Either_Sym1 b1627829182 a1627829180 c1627829181) t -> () Source # type Apply (TyFun b1627829182 c1627829181 -> Type) (TyFun (Either a1627829180 b1627829182) c1627829181 -> Type) (Either_Sym1 b1627829182 a1627829180 c1627829181 l1) l0 Source # type Apply (TyFun b1627829182 c1627829181 -> Type) (TyFun (Either a1627829180 b1627829182) c1627829181 -> Type) (Either_Sym1 b1627829182 a1627829180 c1627829181 l1) l0 = Either_Sym2 b1627829182 a1627829180 c1627829181 l1 l0

data Either_Sym2 l l l Source #

Instances

 SuppressUnusedWarnings ((TyFun a1627829180 c1627829181 -> Type) -> (TyFun b1627829182 c1627829181 -> Type) -> TyFun (Either a1627829180 b1627829182) c1627829181 -> *) (Either_Sym2 b1627829182 a1627829180 c1627829181) Source # MethodssuppressUnusedWarnings :: Proxy (Either_Sym2 b1627829182 a1627829180 c1627829181) t -> () Source # type Apply (Either a1627829180 b1627829182) c1627829181 (Either_Sym2 b1627829182 a1627829180 c1627829181 l1 l2) l0 Source # type Apply (Either a1627829180 b1627829182) c1627829181 (Either_Sym2 b1627829182 a1627829180 c1627829181 l1 l2) l0 = Either_Sym3 a1627829180 c1627829181 b1627829182 l1 l2 l0

type Either_Sym3 t t t = Either_ t t t Source #

data LeftsSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun [Either a1627830454 b1627830455] [a1627830454] -> *) (LeftsSym0 b1627830455 a1627830454) Source # MethodssuppressUnusedWarnings :: Proxy (LeftsSym0 b1627830455 a1627830454) t -> () Source # type Apply [Either a1627830454 b1627830455] [a1627830454] (LeftsSym0 b1627830455 a1627830454) l0 Source # type Apply [Either a1627830454 b1627830455] [a1627830454] (LeftsSym0 b1627830455 a1627830454) l0 = LeftsSym1 a1627830454 b1627830455 l0

type LeftsSym1 t = Lefts t Source #

data RightsSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun [Either a1627830452 b1627830453] [b1627830453] -> *) (RightsSym0 a1627830452 b1627830453) Source # MethodssuppressUnusedWarnings :: Proxy (RightsSym0 a1627830452 b1627830453) t -> () Source # type Apply [Either a1627830452 b1627830453] [b1627830453] (RightsSym0 a1627830452 b1627830453) l0 Source # type Apply [Either a1627830452 b1627830453] [b1627830453] (RightsSym0 a1627830452 b1627830453) l0 = RightsSym1 a1627830452 b1627830453 l0

data IsLeftSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun (Either a1627830448 b1627830449) Bool -> *) (IsLeftSym0 a1627830448 b1627830449) Source # MethodssuppressUnusedWarnings :: Proxy (IsLeftSym0 a1627830448 b1627830449) t -> () Source # type Apply (Either a1627830448 b1627830449) Bool (IsLeftSym0 a1627830448 b1627830449) l0 Source # type Apply (Either a1627830448 b1627830449) Bool (IsLeftSym0 a1627830448 b1627830449) l0 = IsLeftSym1 a1627830448 b1627830449 l0

data IsRightSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun (Either a1627830446 b1627830447) Bool -> *) (IsRightSym0 a1627830446 b1627830447) Source # MethodssuppressUnusedWarnings :: Proxy (IsRightSym0 a1627830446 b1627830447) t -> () Source # type Apply (Either a1627830446 b1627830447) Bool (IsRightSym0 a1627830446 b1627830447) l0 Source # type Apply (Either a1627830446 b1627830447) Bool (IsRightSym0 a1627830446 b1627830447) l0 = IsRightSym1 a1627830446 b1627830447 l0