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 |
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
- type SEither = (Sing :: Either a b -> *)
- either_ :: forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
- type family Either_ a a a :: c
- 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 :: [a]
- sLefts :: forall t. Sing t -> Sing (Apply LeftsSym0 t :: [a])
- type family Rights a :: [b]
- sRights :: forall t. Sing t -> Sing (Apply RightsSym0 t :: [b])
- type family PartitionEithers a :: ([a], [b])
- sPartitionEithers :: forall t. Sing t -> Sing (Apply PartitionEithersSym0 t :: ([a], [b]))
- type family IsLeft a :: Bool
- sIsLeft :: forall t. Sing t -> Sing (Apply IsLeftSym0 t :: Bool)
- type family IsRight a :: Bool
- 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.
data Sing Bool where Source | |
data Sing Ordering where Source | |
data Sing * where Source | |
data Sing Nat where Source | |
data Sing Symbol where
| |
data Sing () where Source | |
data Sing [a0] where Source | |
data Sing (Maybe a0) where Source | |
data Sing (TyFun k1 k2 -> *) = SLambda {} Source | |
data Sing (Either a0 b0) where Source | |
data Sing ((,) a0 b0) where Source | |
data Sing ((,,) a0 b0 c0) where Source | |
data Sing ((,,,) a0 b0 c0 d0) where Source | |
data Sing ((,,,,) a0 b0 c0 d0 e0) where Source | |
data Sing ((,,,,,) a0 b0 c0 d0 e0 f0) where Source | |
data Sing ((,,,,,,) a0 b0 c0 d0 e0 f0 g0) where 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
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 :: ([a], [b]) Source
PartitionEithers a_1627654348 = Apply (Apply (Apply FoldrSym0 (Apply (Apply Either_Sym0 (Let1627654355LeftSym1 a_1627654348)) (Let1627654355RightSym1 a_1627654348))) (Apply (Apply Tuple2Sym0 `[]`) `[]`)) a_1627654348 |
sPartitionEithers :: forall t. Sing t -> Sing (Apply PartitionEithersSym0 t :: ([a], [b])) Source
Defunctionalization symbols
data Either_Sym0 l Source
SuppressUnusedWarnings (TyFun (TyFun k k -> *) (TyFun (TyFun k k -> *) (TyFun (Either k k) k -> *) -> *) -> *) (Either_Sym0 k k k) Source | |
type Apply (TyFun (TyFun k2 k1 -> *) (TyFun (Either k k2) k1 -> *) -> *) (TyFun k k1 -> *) (Either_Sym0 k k1 k2) l0 = Either_Sym1 k k1 k2 l0 Source |
data Either_Sym1 l l Source
SuppressUnusedWarnings ((TyFun k k -> *) -> TyFun (TyFun k k -> *) (TyFun (Either k k) k -> *) -> *) (Either_Sym1 k k k) Source | |
type Apply (TyFun (Either k1 k) k2 -> *) (TyFun k k2 -> *) (Either_Sym1 k1 k2 k l1) l0 = Either_Sym2 k1 k2 k l1 l0 Source |
data Either_Sym2 l l l Source
SuppressUnusedWarnings ((TyFun k k -> *) -> (TyFun k k -> *) -> TyFun (Either k k) k -> *) (Either_Sym2 k k k) Source | |
type Apply k1 (Either k k2) (Either_Sym2 k k1 k2 l1 l2) l0 = Either_Sym3 k k1 k2 l1 l2 l0 Source |
type Either_Sym3 t t t = Either_ t t t Source
data RightsSym0 l Source
SuppressUnusedWarnings (TyFun [Either k k] [k] -> *) (RightsSym0 k k) Source | |
type Apply [k] [Either k1 k] (RightsSym0 k1 k) l0 = RightsSym1 k1 k l0 Source |
type RightsSym1 t = Rights t Source
data IsLeftSym0 l Source
SuppressUnusedWarnings (TyFun (Either k k) Bool -> *) (IsLeftSym0 k k) Source | |
type Apply Bool (Either k k1) (IsLeftSym0 k k1) l0 = IsLeftSym1 k k1 l0 Source |
type IsLeftSym1 t = IsLeft t Source
data IsRightSym0 l Source
SuppressUnusedWarnings (TyFun (Either k k) Bool -> *) (IsRightSym0 k k) Source | |
type Apply Bool (Either k k1) (IsRightSym0 k k1) l0 = IsRightSym1 k k1 l0 Source |
type IsRightSym1 t = IsRight t Source