singletons-2.2: A framework for generating singleton types

Copyright(C) 2014 Jan Stolarek
LicenseBSD-style (see LICENSE)
Maintainerjan.stolarek@p.lodz.pl
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Promotion.Prelude.Either

Contents

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 #

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

Equations

Either_ f _z_6989586621679761264 (Left x) = Apply f x 
Either_ _z_6989586621679761268 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 ... #

Equations

Lefts '[] = '[] 
Lefts ((:) (Left x) xs) = Apply (Apply (:$) x) (Apply LeftsSym0 xs) 
Lefts ((:) (Right _z_6989586621679762609) xs) = Apply LeftsSym0 xs 

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

Equations

Rights '[] = '[] 
Rights ((:) (Left _z_6989586621679762597) xs) = Apply RightsSym0 xs 
Rights ((:) (Right x) xs) = Apply (Apply (:$) x) (Apply RightsSym0 xs) 

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

Equations

PartitionEithers a_6989586621679762551 = Apply (Apply (Apply FoldrSym0 (Apply (Apply Either_Sym0 (Let6989586621679762558LeftSym1 a_6989586621679762551)) (Let6989586621679762558RightSym1 a_6989586621679762551))) (Apply (Apply Tuple2Sym0 '[]) '[])) a_6989586621679762551 

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

Equations

IsLeft (Left _z_6989586621679762545) = TrueSym0 
IsLeft (Right _z_6989586621679762548) = FalseSym0 

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

Equations

IsRight (Left _z_6989586621679762535) = FalseSym0 
IsRight (Right _z_6989586621679762538) = TrueSym0 

Defunctionalization symbols

data LeftSym0 l #

Instances

SuppressUnusedWarnings (TyFun a6989586621679054093 (Either a6989586621679054093 b6989586621679054094) -> *) (LeftSym0 a6989586621679054093 b6989586621679054094) # 

Methods

suppressUnusedWarnings :: Proxy (LeftSym0 a6989586621679054093 b6989586621679054094) t -> () #

type Apply a6989586621679054093 (Either a6989586621679054093 b6989586621679054094) (LeftSym0 a6989586621679054093 b6989586621679054094) l0 # 
type Apply a6989586621679054093 (Either a6989586621679054093 b6989586621679054094) (LeftSym0 a6989586621679054093 b6989586621679054094) l0 = LeftSym1 b6989586621679054094 a6989586621679054093 l0

type LeftSym1 t = Left t #

data RightSym0 l #

Instances

SuppressUnusedWarnings (TyFun b6989586621679054094 (Either a6989586621679054093 b6989586621679054094) -> *) (RightSym0 a6989586621679054093 b6989586621679054094) # 

Methods

suppressUnusedWarnings :: Proxy (RightSym0 a6989586621679054093 b6989586621679054094) t -> () #

type Apply b6989586621679054094 (Either a6989586621679054093 b6989586621679054094) (RightSym0 a6989586621679054093 b6989586621679054094) l0 # 
type Apply b6989586621679054094 (Either a6989586621679054093 b6989586621679054094) (RightSym0 a6989586621679054093 b6989586621679054094) l0 = RightSym1 a6989586621679054093 b6989586621679054094 l0

type RightSym1 t = Right t #

data Either_Sym0 l #

Instances

SuppressUnusedWarnings (TyFun (TyFun a6989586621679761240 c6989586621679761241 -> Type) (TyFun (TyFun b6989586621679761242 c6989586621679761241 -> Type) (TyFun (Either a6989586621679761240 b6989586621679761242) c6989586621679761241 -> Type) -> Type) -> *) (Either_Sym0 a6989586621679761240 b6989586621679761242 c6989586621679761241) # 

Methods

suppressUnusedWarnings :: Proxy (Either_Sym0 a6989586621679761240 b6989586621679761242 c6989586621679761241) t -> () #

type Apply (TyFun a6989586621679761240 c6989586621679761241 -> Type) (TyFun (TyFun b6989586621679761242 c6989586621679761241 -> Type) (TyFun (Either a6989586621679761240 b6989586621679761242) c6989586621679761241 -> Type) -> Type) (Either_Sym0 a6989586621679761240 b6989586621679761242 c6989586621679761241) l0 # 
type Apply (TyFun a6989586621679761240 c6989586621679761241 -> Type) (TyFun (TyFun b6989586621679761242 c6989586621679761241 -> Type) (TyFun (Either a6989586621679761240 b6989586621679761242) c6989586621679761241 -> Type) -> Type) (Either_Sym0 a6989586621679761240 b6989586621679761242 c6989586621679761241) l0 = Either_Sym1 b6989586621679761242 a6989586621679761240 c6989586621679761241 l0

data Either_Sym1 l l #

Instances

SuppressUnusedWarnings ((TyFun a6989586621679761240 c6989586621679761241 -> Type) -> TyFun (TyFun b6989586621679761242 c6989586621679761241 -> Type) (TyFun (Either a6989586621679761240 b6989586621679761242) c6989586621679761241 -> Type) -> *) (Either_Sym1 b6989586621679761242 a6989586621679761240 c6989586621679761241) # 

Methods

suppressUnusedWarnings :: Proxy (Either_Sym1 b6989586621679761242 a6989586621679761240 c6989586621679761241) t -> () #

type Apply (TyFun b6989586621679761242 c6989586621679761241 -> Type) (TyFun (Either a6989586621679761240 b6989586621679761242) c6989586621679761241 -> Type) (Either_Sym1 b6989586621679761242 a6989586621679761240 c6989586621679761241 l0) l1 # 
type Apply (TyFun b6989586621679761242 c6989586621679761241 -> Type) (TyFun (Either a6989586621679761240 b6989586621679761242) c6989586621679761241 -> Type) (Either_Sym1 b6989586621679761242 a6989586621679761240 c6989586621679761241 l0) l1 = Either_Sym2 b6989586621679761242 a6989586621679761240 c6989586621679761241 l0 l1

data Either_Sym2 l l l #

Instances

SuppressUnusedWarnings ((TyFun a6989586621679761240 c6989586621679761241 -> Type) -> (TyFun b6989586621679761242 c6989586621679761241 -> Type) -> TyFun (Either a6989586621679761240 b6989586621679761242) c6989586621679761241 -> *) (Either_Sym2 b6989586621679761242 a6989586621679761240 c6989586621679761241) # 

Methods

suppressUnusedWarnings :: Proxy (Either_Sym2 b6989586621679761242 a6989586621679761240 c6989586621679761241) t -> () #

type Apply (Either a6989586621679761240 b6989586621679761242) c6989586621679761241 (Either_Sym2 b6989586621679761242 a6989586621679761240 c6989586621679761241 l1 l0) l2 # 
type Apply (Either a6989586621679761240 b6989586621679761242) c6989586621679761241 (Either_Sym2 b6989586621679761242 a6989586621679761240 c6989586621679761241 l1 l0) l2 = Either_Sym3 b6989586621679761242 a6989586621679761240 c6989586621679761241 l1 l0 l2

type Either_Sym3 t t t = Either_ t t t #

data LeftsSym0 l #

Instances

SuppressUnusedWarnings (TyFun [Either a6989586621679762510 b6989586621679762511] [a6989586621679762510] -> *) (LeftsSym0 b6989586621679762511 a6989586621679762510) # 

Methods

suppressUnusedWarnings :: Proxy (LeftsSym0 b6989586621679762511 a6989586621679762510) t -> () #

type Apply [Either a6989586621679762510 b6989586621679762511] [a6989586621679762510] (LeftsSym0 b6989586621679762511 a6989586621679762510) l0 # 
type Apply [Either a6989586621679762510 b6989586621679762511] [a6989586621679762510] (LeftsSym0 b6989586621679762511 a6989586621679762510) l0 = LeftsSym1 a6989586621679762510 b6989586621679762511 l0

type LeftsSym1 t = Lefts t #

data RightsSym0 l #

Instances

SuppressUnusedWarnings (TyFun [Either a6989586621679762508 b6989586621679762509] [b6989586621679762509] -> *) (RightsSym0 a6989586621679762508 b6989586621679762509) # 

Methods

suppressUnusedWarnings :: Proxy (RightsSym0 a6989586621679762508 b6989586621679762509) t -> () #

type Apply [Either a6989586621679762508 b6989586621679762509] [b6989586621679762509] (RightsSym0 a6989586621679762508 b6989586621679762509) l0 # 
type Apply [Either a6989586621679762508 b6989586621679762509] [b6989586621679762509] (RightsSym0 a6989586621679762508 b6989586621679762509) l0 = RightsSym1 a6989586621679762508 b6989586621679762509 l0

type RightsSym1 t = Rights t #

data IsLeftSym0 l #

Instances

SuppressUnusedWarnings (TyFun (Either a6989586621679762504 b6989586621679762505) Bool -> *) (IsLeftSym0 a6989586621679762504 b6989586621679762505) # 

Methods

suppressUnusedWarnings :: Proxy (IsLeftSym0 a6989586621679762504 b6989586621679762505) t -> () #

type Apply (Either a6989586621679762504 b6989586621679762505) Bool (IsLeftSym0 a6989586621679762504 b6989586621679762505) l0 # 
type Apply (Either a6989586621679762504 b6989586621679762505) Bool (IsLeftSym0 a6989586621679762504 b6989586621679762505) l0 = IsLeftSym1 a6989586621679762504 b6989586621679762505 l0

type IsLeftSym1 t = IsLeft t #

data IsRightSym0 l #

Instances

SuppressUnusedWarnings (TyFun (Either a6989586621679762502 b6989586621679762503) Bool -> *) (IsRightSym0 a6989586621679762502 b6989586621679762503) # 

Methods

suppressUnusedWarnings :: Proxy (IsRightSym0 a6989586621679762502 b6989586621679762503) t -> () #

type Apply (Either a6989586621679762502 b6989586621679762503) Bool (IsRightSym0 a6989586621679762502 b6989586621679762503) l0 # 
type Apply (Either a6989586621679762502 b6989586621679762503) Bool (IsRightSym0 a6989586621679762502 b6989586621679762503) l0 = IsRightSym1 a6989586621679762502 b6989586621679762503 l0

type IsRightSym1 t = IsRight t #