singletons-2.3.1: 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_ :: (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_6989586621679369613 (Left x) = Apply f x 
Either_ _z_6989586621679369617 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_6989586621679370800) xs) = Apply LeftsSym0 xs 

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

Equations

Rights '[] = '[] 
Rights ((:) (Left _z_6989586621679370788) 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_6989586621679370742 = Apply (Apply (Apply FoldrSym0 (Apply (Apply Either_Sym0 (Let6989586621679370749LeftSym1 a_6989586621679370742)) (Let6989586621679370749RightSym1 a_6989586621679370742))) (Apply (Apply Tuple2Sym0 '[]) '[])) a_6989586621679370742 

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

Equations

IsLeft (Left _z_6989586621679370736) = TrueSym0 
IsLeft (Right _z_6989586621679370739) = FalseSym0 

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

Equations

IsRight (Left _z_6989586621679370726) = FalseSym0 
IsRight (Right _z_6989586621679370729) = TrueSym0 

Defunctionalization symbols

data LeftSym0 (l :: TyFun a6989586621679073591 (Either a6989586621679073591 b6989586621679073592)) #

Instances

SuppressUnusedWarnings (TyFun a6989586621679073591 (Either a6989586621679073591 b6989586621679073592) -> *) (LeftSym0 a6989586621679073591 b6989586621679073592) # 

Methods

suppressUnusedWarnings :: Proxy (LeftSym0 a6989586621679073591 b6989586621679073592) t -> () #

type Apply a (Either a b6989586621679073592) (LeftSym0 a b6989586621679073592) l # 
type Apply a (Either a b6989586621679073592) (LeftSym0 a b6989586621679073592) l = Left a b6989586621679073592 l

type LeftSym1 (t :: a6989586621679073591) = Left t #

data RightSym0 (l :: TyFun b6989586621679073592 (Either a6989586621679073591 b6989586621679073592)) #

Instances

SuppressUnusedWarnings (TyFun b6989586621679073592 (Either a6989586621679073591 b6989586621679073592) -> *) (RightSym0 a6989586621679073591 b6989586621679073592) # 

Methods

suppressUnusedWarnings :: Proxy (RightSym0 a6989586621679073591 b6989586621679073592) t -> () #

type Apply b (Either a6989586621679073591 b) (RightSym0 a6989586621679073591 b) l # 
type Apply b (Either a6989586621679073591 b) (RightSym0 a6989586621679073591 b) l = Right a6989586621679073591 b l

type RightSym1 (t :: b6989586621679073592) = Right t #

data Either_Sym0 (l :: TyFun (TyFun a6989586621679369589 c6989586621679369590 -> Type) (TyFun (TyFun b6989586621679369591 c6989586621679369590 -> Type) (TyFun (Either a6989586621679369589 b6989586621679369591) c6989586621679369590 -> Type) -> Type)) #

Instances

SuppressUnusedWarnings (TyFun (TyFun a6989586621679369589 c6989586621679369590 -> Type) (TyFun (TyFun b6989586621679369591 c6989586621679369590 -> Type) (TyFun (Either a6989586621679369589 b6989586621679369591) c6989586621679369590 -> Type) -> Type) -> *) (Either_Sym0 a6989586621679369589 b6989586621679369591 c6989586621679369590) # 

Methods

suppressUnusedWarnings :: Proxy (Either_Sym0 a6989586621679369589 b6989586621679369591 c6989586621679369590) t -> () #

type Apply (TyFun a6989586621679369589 c6989586621679369590 -> Type) (TyFun (TyFun b6989586621679369591 c6989586621679369590 -> Type) (TyFun (Either a6989586621679369589 b6989586621679369591) c6989586621679369590 -> Type) -> Type) (Either_Sym0 a6989586621679369589 b6989586621679369591 c6989586621679369590) l # 
type Apply (TyFun a6989586621679369589 c6989586621679369590 -> Type) (TyFun (TyFun b6989586621679369591 c6989586621679369590 -> Type) (TyFun (Either a6989586621679369589 b6989586621679369591) c6989586621679369590 -> Type) -> Type) (Either_Sym0 a6989586621679369589 b6989586621679369591 c6989586621679369590) l = Either_Sym1 a6989586621679369589 b6989586621679369591 c6989586621679369590 l

data Either_Sym1 (l :: TyFun a6989586621679369589 c6989586621679369590 -> Type) (l :: TyFun (TyFun b6989586621679369591 c6989586621679369590 -> Type) (TyFun (Either a6989586621679369589 b6989586621679369591) c6989586621679369590 -> Type)) #

Instances

SuppressUnusedWarnings ((TyFun a6989586621679369589 c6989586621679369590 -> Type) -> TyFun (TyFun b6989586621679369591 c6989586621679369590 -> Type) (TyFun (Either a6989586621679369589 b6989586621679369591) c6989586621679369590 -> Type) -> *) (Either_Sym1 a6989586621679369589 b6989586621679369591 c6989586621679369590) # 

Methods

suppressUnusedWarnings :: Proxy (Either_Sym1 a6989586621679369589 b6989586621679369591 c6989586621679369590) t -> () #

type Apply (TyFun b6989586621679369591 c6989586621679369590 -> Type) (TyFun (Either a6989586621679369589 b6989586621679369591) c6989586621679369590 -> Type) (Either_Sym1 a6989586621679369589 b6989586621679369591 c6989586621679369590 l1) l2 # 
type Apply (TyFun b6989586621679369591 c6989586621679369590 -> Type) (TyFun (Either a6989586621679369589 b6989586621679369591) c6989586621679369590 -> Type) (Either_Sym1 a6989586621679369589 b6989586621679369591 c6989586621679369590 l1) l2 = Either_Sym2 a6989586621679369589 b6989586621679369591 c6989586621679369590 l1 l2

data Either_Sym2 (l :: TyFun a6989586621679369589 c6989586621679369590 -> Type) (l :: TyFun b6989586621679369591 c6989586621679369590 -> Type) (l :: TyFun (Either a6989586621679369589 b6989586621679369591) c6989586621679369590) #

Instances

SuppressUnusedWarnings ((TyFun a6989586621679369589 c6989586621679369590 -> Type) -> (TyFun b6989586621679369591 c6989586621679369590 -> Type) -> TyFun (Either a6989586621679369589 b6989586621679369591) c6989586621679369590 -> *) (Either_Sym2 a6989586621679369589 b6989586621679369591 c6989586621679369590) # 

Methods

suppressUnusedWarnings :: Proxy (Either_Sym2 a6989586621679369589 b6989586621679369591 c6989586621679369590) t -> () #

type Apply (Either a b) c (Either_Sym2 a b c l1 l2) l3 # 
type Apply (Either a b) c (Either_Sym2 a b c l1 l2) l3 = Either_ a b c l1 l2 l3

type Either_Sym3 (t :: TyFun a6989586621679369589 c6989586621679369590 -> Type) (t :: TyFun b6989586621679369591 c6989586621679369590 -> Type) (t :: Either a6989586621679369589 b6989586621679369591) = Either_ t t t #

data LeftsSym0 (l :: TyFun [Either a6989586621679370701 b6989586621679370702] [a6989586621679370701]) #

Instances

SuppressUnusedWarnings (TyFun [Either a6989586621679370701 b6989586621679370702] [a6989586621679370701] -> *) (LeftsSym0 b6989586621679370702 a6989586621679370701) # 

Methods

suppressUnusedWarnings :: Proxy (LeftsSym0 b6989586621679370702 a6989586621679370701) t -> () #

type Apply [Either a b] [a] (LeftsSym0 b a) l # 
type Apply [Either a b] [a] (LeftsSym0 b a) l = Lefts b a l

type LeftsSym1 (t :: [Either a6989586621679370701 b6989586621679370702]) = Lefts t #

data RightsSym0 (l :: TyFun [Either a6989586621679370699 b6989586621679370700] [b6989586621679370700]) #

Instances

SuppressUnusedWarnings (TyFun [Either a6989586621679370699 b6989586621679370700] [b6989586621679370700] -> *) (RightsSym0 a6989586621679370699 b6989586621679370700) # 

Methods

suppressUnusedWarnings :: Proxy (RightsSym0 a6989586621679370699 b6989586621679370700) t -> () #

type Apply [Either a b] [b] (RightsSym0 a b) l # 
type Apply [Either a b] [b] (RightsSym0 a b) l = Rights a b l

type RightsSym1 (t :: [Either a6989586621679370699 b6989586621679370700]) = Rights t #

data IsLeftSym0 (l :: TyFun (Either a6989586621679370695 b6989586621679370696) Bool) #

Instances

SuppressUnusedWarnings (TyFun (Either a6989586621679370695 b6989586621679370696) Bool -> *) (IsLeftSym0 a6989586621679370695 b6989586621679370696) # 

Methods

suppressUnusedWarnings :: Proxy (IsLeftSym0 a6989586621679370695 b6989586621679370696) t -> () #

type Apply (Either a b) Bool (IsLeftSym0 a b) l # 
type Apply (Either a b) Bool (IsLeftSym0 a b) l = IsLeft a b l

type IsLeftSym1 (t :: Either a6989586621679370695 b6989586621679370696) = IsLeft t #

data IsRightSym0 (l :: TyFun (Either a6989586621679370693 b6989586621679370694) Bool) #

Instances

SuppressUnusedWarnings (TyFun (Either a6989586621679370693 b6989586621679370694) Bool -> *) (IsRightSym0 a6989586621679370693 b6989586621679370694) # 

Methods

suppressUnusedWarnings :: Proxy (IsRightSym0 a6989586621679370693 b6989586621679370694) t -> () #

type Apply (Either a b) Bool (IsRightSym0 a b) l # 
type Apply (Either a b) Bool (IsRightSym0 a b) l = IsRight a b l

type IsRightSym1 (t :: Either a6989586621679370693 b6989586621679370694) = IsRight t #