| 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
data family Sing (a :: k) Source #
The singleton kind-indexed data family.
Instances
| data Sing Bool Source # | |
| data Sing Ordering Source # | |
| data Sing * Source # | |
| data Sing Nat Source # | |
| data Sing Symbol Source # | |
| data Sing () Source # | |
| data Sing [a0] Source # | |
| data Sing (Maybe a0) Source # | |
| data Sing (NonEmpty a0) Source # | |
| data Sing (Either a0 b0) Source # | |
| data Sing (a0, b0) Source # | |
| data Sing ((~>) k1 k2) Source # | |
| data Sing (a0, b0, c0) Source # | |
| data Sing (a0, b0, c0, d0) Source # | |
| data Sing (a0, b0, c0, d0, e0) Source # | |
| data Sing (a0, b0, c0, d0, e0, f0) Source # | |
| data Sing (a0, b0, c0, d0, e0, f0, g0) Source # | |
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 ... Source #
sEither_ :: forall t t t. Sing t -> Sing t -> Sing t -> Sing (Apply (Apply (Apply Either_Sym0 t) t) t :: c) Source #
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 ... Source #
Equations
| PartitionEithers a_1627830495 = Apply (Apply (Apply FoldrSym0 (Apply (Apply Either_Sym0 (Let1627830502LeftSym1 a_1627830495)) (Let1627830502RightSym1 a_1627830495))) (Apply (Apply Tuple2Sym0 '[]) '[])) a_1627830495 |
Defunctionalization symbols
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 # | |
| 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 # | |
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 # | |
| type Apply (TyFun b1627829182 c1627829181 -> Type) (TyFun (Either a1627829180 b1627829182) c1627829181 -> Type) (Either_Sym1 b1627829182 a1627829180 c1627829181 l1) l0 Source # | |
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 # | |
| type Apply (Either a1627829180 b1627829182) c1627829181 (Either_Sym2 b1627829182 a1627829180 c1627829181 l1 l2) l0 Source # | |
type Either_Sym3 t t t = Either_ t t t Source #
data RightsSym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun [Either a1627830452 b1627830453] [b1627830453] -> *) (RightsSym0 a1627830452 b1627830453) Source # | |
| type Apply [Either a1627830452 b1627830453] [b1627830453] (RightsSym0 a1627830452 b1627830453) l0 Source # | |
type RightsSym1 t = Rights t Source #
data IsLeftSym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun (Either a1627830448 b1627830449) Bool -> *) (IsLeftSym0 a1627830448 b1627830449) Source # | |
| type Apply (Either a1627830448 b1627830449) Bool (IsLeftSym0 a1627830448 b1627830449) l0 Source # | |
type IsLeftSym1 t = IsLeft t Source #
data IsRightSym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun (Either a1627830446 b1627830447) Bool -> *) (IsRightSym0 a1627830446 b1627830447) Source # | |
| type Apply (Either a1627830446 b1627830447) Bool (IsRightSym0 a1627830446 b1627830447) l0 Source # | |
type IsRightSym1 t = IsRight t Source #