| Copyright | (C) 2013-2014 Richard Eisenberg Jan Stolarek |
|---|---|
| License | BSD-style (see LICENSE) |
| Maintainer | Richard Eisenberg (eir@cis.upenn.edu) |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Singletons.Prelude.Either
Description
Defines functions and datatypes relating to the singleton for Either,
including a singletons 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.
- data family Sing (a :: k)
- type SEither = (Sing :: Either a b -> Type)
- 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 ...
- sEither_ :: forall t t t. Sing t -> Sing t -> Sing t -> Sing (Apply (Apply (Apply Either_Sym0 t) t) t :: c)
- type family Lefts (a :: [Either a b]) :: [a] where ...
- sLefts :: forall t. Sing t -> Sing (Apply LeftsSym0 t :: [a])
- type family Rights (a :: [Either a b]) :: [b] where ...
- sRights :: forall t. Sing t -> Sing (Apply RightsSym0 t :: [b])
- type family PartitionEithers (a :: [Either a b]) :: ([a], [b]) where ...
- sPartitionEithers :: forall t. Sing t -> Sing (Apply PartitionEithersSym0 t :: ([a], [b]))
- type family IsLeft (a :: Either a b) :: Bool where ...
- sIsLeft :: forall t. Sing t -> Sing (Apply IsLeftSym0 t :: Bool)
- type family IsRight (a :: Either a b) :: Bool where ...
- sIsRight :: forall t. Sing t -> Sing (Apply IsRightSym0 t :: Bool)
- data LeftSym0 l
- type LeftSym1 t = Left t
- data RightSym0 l
- type RightSym1 t = Right t
- data Either_Sym0 l
- data Either_Sym1 l l
- data Either_Sym2 l l l
- type Either_Sym3 t t t = Either_ t t t
- data LeftsSym0 l
- type LeftsSym1 t = Lefts t
- data RightsSym0 l
- type RightsSym1 t = Rights t
- data IsLeftSym0 l
- type IsLeftSym1 t = IsLeft t
- data IsRightSym0 l
- type IsRightSym1 t = IsRight t
The Either singleton
The singleton kind-indexed data family.
Instances
| data Sing Bool # | |
| data Sing Ordering # | |
| data Sing * # | |
| data Sing Nat # | |
| data Sing Symbol # | |
| data Sing () # | |
| data Sing [a0] # | |
| data Sing (Maybe a0) # | |
| data Sing (NonEmpty a0) # | |
| data Sing (Either a0 b0) # | |
| data Sing (a0, b0) # | |
| data Sing ((~>) k1 k2) # | |
| data Sing (a0, b0, c0) # | |
| data Sing (a0, b0, c0, d0) # | |
| data Sing (a0, b0, c0, d0, e0) # | |
| data Sing (a0, b0, c0, d0, e0, f0) # | |
| data Sing (a0, b0, c0, d0, e0, f0, g0) # | |
Though Haddock doesn't show it, the Sing instance above declares
constructors
SLeft :: Sing a -> Sing (Left a) SRight :: Sing b -> Sing (Right b)
Singletons from Data.Either
type family Either_ (a :: TyFun a c -> Type) (a :: TyFun b c -> Type) (a :: Either a b) :: c where ... #
sEither_ :: forall t t t. Sing t -> Sing t -> Sing t -> Sing (Apply (Apply (Apply Either_Sym0 t) t) t :: c) #
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 PartitionEithers (a :: [Either a b]) :: ([a], [b]) where ... #
Equations
| PartitionEithers a_6989586621679959493 = Apply (Apply (Apply FoldrSym0 (Apply (Apply Either_Sym0 (Let6989586621679959500LeftSym1 a_6989586621679959493)) (Let6989586621679959500RightSym1 a_6989586621679959493))) (Apply (Apply Tuple2Sym0 '[]) '[])) a_6989586621679959493 |
sPartitionEithers :: forall t. Sing t -> Sing (Apply PartitionEithersSym0 t :: ([a], [b])) #
Defunctionalization symbols
Instances
| SuppressUnusedWarnings (TyFun a6989586621679054093 (Either a6989586621679054093 b6989586621679054094) -> *) (LeftSym0 a6989586621679054093 b6989586621679054094) # | |
| type Apply a6989586621679054093 (Either a6989586621679054093 b6989586621679054094) (LeftSym0 a6989586621679054093 b6989586621679054094) l0 # | |
Instances
| SuppressUnusedWarnings (TyFun b6989586621679054094 (Either a6989586621679054093 b6989586621679054094) -> *) (RightSym0 a6989586621679054093 b6989586621679054094) # | |
| type Apply b6989586621679054094 (Either a6989586621679054093 b6989586621679054094) (RightSym0 a6989586621679054093 b6989586621679054094) l0 # | |
data Either_Sym0 l #
Instances
| SuppressUnusedWarnings (TyFun (TyFun a6989586621679958182 c6989586621679958183 -> Type) (TyFun (TyFun b6989586621679958184 c6989586621679958183 -> Type) (TyFun (Either a6989586621679958182 b6989586621679958184) c6989586621679958183 -> Type) -> Type) -> *) (Either_Sym0 a6989586621679958182 b6989586621679958184 c6989586621679958183) # | |
| type Apply (TyFun a6989586621679958182 c6989586621679958183 -> Type) (TyFun (TyFun b6989586621679958184 c6989586621679958183 -> Type) (TyFun (Either a6989586621679958182 b6989586621679958184) c6989586621679958183 -> Type) -> Type) (Either_Sym0 a6989586621679958182 b6989586621679958184 c6989586621679958183) l0 # | |
data Either_Sym1 l l #
Instances
| SuppressUnusedWarnings ((TyFun a6989586621679958182 c6989586621679958183 -> Type) -> TyFun (TyFun b6989586621679958184 c6989586621679958183 -> Type) (TyFun (Either a6989586621679958182 b6989586621679958184) c6989586621679958183 -> Type) -> *) (Either_Sym1 b6989586621679958184 a6989586621679958182 c6989586621679958183) # | |
| type Apply (TyFun b6989586621679958184 c6989586621679958183 -> Type) (TyFun (Either a6989586621679958182 b6989586621679958184) c6989586621679958183 -> Type) (Either_Sym1 b6989586621679958184 a6989586621679958182 c6989586621679958183 l0) l1 # | |
data Either_Sym2 l l l #
Instances
| SuppressUnusedWarnings ((TyFun a6989586621679958182 c6989586621679958183 -> Type) -> (TyFun b6989586621679958184 c6989586621679958183 -> Type) -> TyFun (Either a6989586621679958182 b6989586621679958184) c6989586621679958183 -> *) (Either_Sym2 b6989586621679958184 a6989586621679958182 c6989586621679958183) # | |
| type Apply (Either a6989586621679958182 b6989586621679958184) c6989586621679958183 (Either_Sym2 b6989586621679958184 a6989586621679958182 c6989586621679958183 l1 l0) l2 # | |
type Either_Sym3 t t t = Either_ t t t #
Instances
| SuppressUnusedWarnings (TyFun [Either a6989586621679959452 b6989586621679959453] [a6989586621679959452] -> *) (LeftsSym0 b6989586621679959453 a6989586621679959452) # | |
| type Apply [Either a6989586621679959452 b6989586621679959453] [a6989586621679959452] (LeftsSym0 b6989586621679959453 a6989586621679959452) l0 # | |
data RightsSym0 l #
Instances
| SuppressUnusedWarnings (TyFun [Either a6989586621679959450 b6989586621679959451] [b6989586621679959451] -> *) (RightsSym0 a6989586621679959450 b6989586621679959451) # | |
| type Apply [Either a6989586621679959450 b6989586621679959451] [b6989586621679959451] (RightsSym0 a6989586621679959450 b6989586621679959451) l0 # | |
type RightsSym1 t = Rights t #
data IsLeftSym0 l #
Instances
| SuppressUnusedWarnings (TyFun (Either a6989586621679959446 b6989586621679959447) Bool -> *) (IsLeftSym0 a6989586621679959446 b6989586621679959447) # | |
| type Apply (Either a6989586621679959446 b6989586621679959447) Bool (IsLeftSym0 a6989586621679959446 b6989586621679959447) l0 # | |
type IsLeftSym1 t = IsLeft t #
data IsRightSym0 l #
Instances
| SuppressUnusedWarnings (TyFun (Either a6989586621679959444 b6989586621679959445) Bool -> *) (IsRightSym0 a6989586621679959444 b6989586621679959445) # | |
| type Apply (Either a6989586621679959444 b6989586621679959445) Bool (IsRightSym0 a6989586621679959444 b6989586621679959445) l0 # | |
type IsRightSym1 t = IsRight t #