singletons-2.4: A framework for generating singleton types

Copyright (C) 2014 Jan Stolarek BSD-style (see LICENSE) jan.stolarek@p.lodz.pl experimental non-portable None Haskell2010

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_ :: (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 _ (Left x) = Apply f x Either_ _ 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 _) xs) = Apply LeftsSym0 xs type family Rights (a :: [Either a b]) :: [b] where ... Source # Equations  Rights '[] = '[] Rights ((:) (Left _) 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_6989586621679913642 = Apply (Apply (Apply FoldrSym0 (Apply (Apply Either_Sym0 (Let6989586621679913649LeftSym1 a_6989586621679913642)) (Let6989586621679913649RightSym1 a_6989586621679913642))) (Apply (Apply Tuple2Sym0 '[]) '[])) a_6989586621679913642

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

Equations

 IsLeft (Left _) = TrueSym0 IsLeft (Right _) = FalseSym0

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

Equations

 IsRight (Left _) = FalseSym0 IsRight (Right _) = TrueSym0

# Defunctionalization symbols

data LeftSym0 (l :: TyFun a6989586621679082339 (Either a6989586621679082339 b6989586621679082340)) Source #

Instances
 SuppressUnusedWarnings (LeftSym0 :: TyFun a6989586621679082339 (Either a6989586621679082339 b6989586621679082340) -> *) Source # Instance detailsMethods type Apply (LeftSym0 :: TyFun a (Either a b6989586621679082340) -> *) (l :: a) Source # Instance detailstype Apply (LeftSym0 :: TyFun a (Either a b6989586621679082340) -> *) (l :: a) = (Left l :: Either a b6989586621679082340)

type LeftSym1 (t :: a6989586621679082339) = Left t Source #

data RightSym0 (l :: TyFun b6989586621679082340 (Either a6989586621679082339 b6989586621679082340)) Source #

Instances
 SuppressUnusedWarnings (RightSym0 :: TyFun b6989586621679082340 (Either a6989586621679082339 b6989586621679082340) -> *) Source # Instance detailsMethods type Apply (RightSym0 :: TyFun b (Either a6989586621679082339 b) -> *) (l :: b) Source # Instance detailstype Apply (RightSym0 :: TyFun b (Either a6989586621679082339 b) -> *) (l :: b) = (Right l :: Either a6989586621679082339 b)

type RightSym1 (t :: b6989586621679082340) = Right t Source #

data Either_Sym0 (l :: TyFun (TyFun a6989586621679912139 c6989586621679912140 -> Type) (TyFun (TyFun b6989586621679912141 c6989586621679912140 -> Type) (TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140 -> Type) -> Type)) Source #

Instances
 SuppressUnusedWarnings (Either_Sym0 :: TyFun (TyFun a6989586621679912139 c6989586621679912140 -> Type) (TyFun (TyFun b6989586621679912141 c6989586621679912140 -> Type) (TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140 -> Type) -> Type) -> *) Source # Instance detailsMethods type Apply (Either_Sym0 :: TyFun (TyFun a6989586621679912139 c6989586621679912140 -> Type) (TyFun (TyFun b6989586621679912141 c6989586621679912140 -> Type) (TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140 -> Type) -> Type) -> *) (l :: TyFun a6989586621679912139 c6989586621679912140 -> Type) Source # Instance detailstype Apply (Either_Sym0 :: TyFun (TyFun a6989586621679912139 c6989586621679912140 -> Type) (TyFun (TyFun b6989586621679912141 c6989586621679912140 -> Type) (TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140 -> Type) -> Type) -> *) (l :: TyFun a6989586621679912139 c6989586621679912140 -> Type) = (Either_Sym1 l :: TyFun (TyFun b6989586621679912141 c6989586621679912140 -> Type) (TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140 -> Type) -> *)

data Either_Sym1 (l :: TyFun a6989586621679912139 c6989586621679912140 -> Type) (l :: TyFun (TyFun b6989586621679912141 c6989586621679912140 -> Type) (TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140 -> Type)) Source #

Instances
 SuppressUnusedWarnings (Either_Sym1 :: (TyFun a6989586621679912139 c6989586621679912140 -> Type) -> TyFun (TyFun b6989586621679912141 c6989586621679912140 -> Type) (TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140 -> Type) -> *) Source # Instance detailsMethods type Apply (Either_Sym1 l1 :: TyFun (TyFun b6989586621679912141 c6989586621679912140 -> Type) (TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140 -> Type) -> *) (l2 :: TyFun b6989586621679912141 c6989586621679912140 -> Type) Source # Instance detailstype Apply (Either_Sym1 l1 :: TyFun (TyFun b6989586621679912141 c6989586621679912140 -> Type) (TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140 -> Type) -> *) (l2 :: TyFun b6989586621679912141 c6989586621679912140 -> Type) = Either_Sym2 l1 l2

data Either_Sym2 (l :: TyFun a6989586621679912139 c6989586621679912140 -> Type) (l :: TyFun b6989586621679912141 c6989586621679912140 -> Type) (l :: TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140) Source #

Instances
 SuppressUnusedWarnings (Either_Sym2 :: (TyFun a6989586621679912139 c6989586621679912140 -> Type) -> (TyFun b6989586621679912141 c6989586621679912140 -> Type) -> TyFun (Either a6989586621679912139 b6989586621679912141) c6989586621679912140 -> *) Source # Instance detailsMethods type Apply (Either_Sym2 l1 l2 :: TyFun (Either a b) c -> *) (l3 :: Either a b) Source # Instance detailstype Apply (Either_Sym2 l1 l2 :: TyFun (Either a b) c -> *) (l3 :: Either a b) = Either_ l1 l2 l3

type Either_Sym3 (t :: TyFun a6989586621679912139 c6989586621679912140 -> Type) (t :: TyFun b6989586621679912141 c6989586621679912140 -> Type) (t :: Either a6989586621679912139 b6989586621679912141) = Either_ t t t Source #

data LeftsSym0 (l :: TyFun [Either a6989586621679913275 b6989586621679913276] [a6989586621679913275]) Source #

Instances
 SuppressUnusedWarnings (LeftsSym0 :: TyFun [Either a6989586621679913275 b6989586621679913276] [a6989586621679913275] -> *) Source # Instance detailsMethods type Apply (LeftsSym0 :: TyFun [Either a b] [a] -> *) (l :: [Either a b]) Source # Instance detailstype Apply (LeftsSym0 :: TyFun [Either a b] [a] -> *) (l :: [Either a b]) = Lefts l

type LeftsSym1 (t :: [Either a6989586621679913275 b6989586621679913276]) = Lefts t Source #

data RightsSym0 (l :: TyFun [Either a6989586621679913273 b6989586621679913274] [b6989586621679913274]) Source #

Instances
 SuppressUnusedWarnings (RightsSym0 :: TyFun [Either a6989586621679913273 b6989586621679913274] [b6989586621679913274] -> *) Source # Instance detailsMethods type Apply (RightsSym0 :: TyFun [Either a b] [b] -> *) (l :: [Either a b]) Source # Instance detailstype Apply (RightsSym0 :: TyFun [Either a b] [b] -> *) (l :: [Either a b]) = Rights l

type RightsSym1 (t :: [Either a6989586621679913273 b6989586621679913274]) = Rights t Source #

data IsLeftSym0 (l :: TyFun (Either a6989586621679913269 b6989586621679913270) Bool) Source #

Instances
 SuppressUnusedWarnings (IsLeftSym0 :: TyFun (Either a6989586621679913269 b6989586621679913270) Bool -> *) Source # Instance detailsMethods type Apply (IsLeftSym0 :: TyFun (Either a b) Bool -> *) (l :: Either a b) Source # Instance detailstype Apply (IsLeftSym0 :: TyFun (Either a b) Bool -> *) (l :: Either a b) = IsLeft l

type IsLeftSym1 (t :: Either a6989586621679913269 b6989586621679913270) = IsLeft t Source #

data IsRightSym0 (l :: TyFun (Either a6989586621679913267 b6989586621679913268) Bool) Source #

Instances
 SuppressUnusedWarnings (IsRightSym0 :: TyFun (Either a6989586621679913267 b6989586621679913268) Bool -> *) Source # Instance detailsMethods type Apply (IsRightSym0 :: TyFun (Either a b) Bool -> *) (l :: Either a b) Source # Instance detailstype Apply (IsRightSym0 :: TyFun (Either a b) Bool -> *) (l :: Either a b) = IsRight l

type IsRightSym1 (t :: Either a6989586621679913267 b6989586621679913268) = IsRight t Source #