| Copyright | (C) 2013-2014 Richard Eisenberg Jan Stolarek |
|---|---|
| License | BSD-style (see LICENSE) |
| Maintainer | Richard Eisenberg (rae@cs.brynmawr.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_ :: (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 :: TyFun a c -> Type) (t :: TyFun b c -> Type) (t :: Either a b). 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 :: [Either a b]). Sing t -> Sing (Apply LeftsSym0 t :: [a])
- type family Rights (a :: [Either a b]) :: [b] where ...
- sRights :: forall (t :: [Either a b]). Sing t -> Sing (Apply RightsSym0 t :: [b])
- type family PartitionEithers (a :: [Either a b]) :: ([a], [b]) where ...
- sPartitionEithers :: forall (t :: [Either a b]). Sing t -> Sing (Apply PartitionEithersSym0 t :: ([a], [b]))
- type family IsLeft (a :: Either a b) :: Bool where ...
- sIsLeft :: forall (t :: Either a b). Sing t -> Sing (Apply IsLeftSym0 t :: Bool)
- type family IsRight (a :: Either a b) :: Bool where ...
- sIsRight :: forall (t :: Either a b). Sing t -> Sing (Apply IsRightSym0 t :: Bool)
- data LeftSym0 (l :: TyFun a6989586621679072801 (Either a6989586621679072801 b6989586621679072802))
- type LeftSym1 (t :: a6989586621679072801) = Left t
- data RightSym0 (l :: TyFun b6989586621679072802 (Either a6989586621679072801 b6989586621679072802))
- type RightSym1 (t :: b6989586621679072802) = Right t
- data Either_Sym0 (l :: TyFun (TyFun a6989586621679433056 c6989586621679433057 -> Type) (TyFun (TyFun b6989586621679433058 c6989586621679433057 -> Type) (TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057 -> Type) -> Type))
- data Either_Sym1 (l :: TyFun a6989586621679433056 c6989586621679433057 -> Type) (l :: TyFun (TyFun b6989586621679433058 c6989586621679433057 -> Type) (TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057 -> Type))
- data Either_Sym2 (l :: TyFun a6989586621679433056 c6989586621679433057 -> Type) (l :: TyFun b6989586621679433058 c6989586621679433057 -> Type) (l :: TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057)
- type Either_Sym3 (t :: TyFun a6989586621679433056 c6989586621679433057 -> Type) (t :: TyFun b6989586621679433058 c6989586621679433057 -> Type) (t :: Either a6989586621679433056 b6989586621679433058) = Either_ t t t
- data LeftsSym0 (l :: TyFun [Either a6989586621679434168 b6989586621679434169] [a6989586621679434168])
- type LeftsSym1 (t :: [Either a6989586621679434168 b6989586621679434169]) = Lefts t
- data RightsSym0 (l :: TyFun [Either a6989586621679434166 b6989586621679434167] [b6989586621679434167])
- type RightsSym1 (t :: [Either a6989586621679434166 b6989586621679434167]) = Rights t
- data IsLeftSym0 (l :: TyFun (Either a6989586621679434162 b6989586621679434163) Bool)
- type IsLeftSym1 (t :: Either a6989586621679434162 b6989586621679434163) = IsLeft t
- data IsRightSym0 (l :: TyFun (Either a6989586621679434160 b6989586621679434161) Bool)
- type IsRightSym1 (t :: Either a6989586621679434160 b6989586621679434161) = 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 [a] Source # | |
| data Sing (Maybe a) Source # | |
| data Sing (NonEmpty a) Source # | |
| data Sing (Either a b) Source # | |
| data Sing (a, b) Source # | |
| data Sing ((~>) k1 k2) Source # | |
| data Sing (a, b, c) Source # | |
| data Sing (a, b, c, d) Source # | |
| data Sing (a, b, c, d, e) Source # | |
| data Sing (a, b, c, d, e, f) Source # | |
| data Sing (a, b, c, d, e, f, g) 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 :: TyFun a c -> Type) (t :: TyFun b c -> Type) (t :: Either a b). 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_6989586621679434209 = Apply (Apply (Apply FoldrSym0 (Apply (Apply Either_Sym0 (Let6989586621679434216LeftSym1 a_6989586621679434209)) (Let6989586621679434216RightSym1 a_6989586621679434209))) (Apply (Apply Tuple2Sym0 '[]) '[])) a_6989586621679434209 |
sPartitionEithers :: forall (t :: [Either a b]). Sing t -> Sing (Apply PartitionEithersSym0 t :: ([a], [b])) Source #
Defunctionalization symbols
data LeftSym0 (l :: TyFun a6989586621679072801 (Either a6989586621679072801 b6989586621679072802)) Source #
data RightSym0 (l :: TyFun b6989586621679072802 (Either a6989586621679072801 b6989586621679072802)) Source #
data Either_Sym0 (l :: TyFun (TyFun a6989586621679433056 c6989586621679433057 -> Type) (TyFun (TyFun b6989586621679433058 c6989586621679433057 -> Type) (TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057 -> Type) -> Type)) Source #
Instances
| SuppressUnusedWarnings (TyFun (TyFun a6989586621679433056 c6989586621679433057 -> Type) (TyFun (TyFun b6989586621679433058 c6989586621679433057 -> Type) (TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057 -> Type) -> Type) -> *) (Either_Sym0 a6989586621679433056 b6989586621679433058 c6989586621679433057) Source # | |
| type Apply (TyFun a6989586621679433056 c6989586621679433057 -> Type) (TyFun (TyFun b6989586621679433058 c6989586621679433057 -> Type) (TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057 -> Type) -> Type) (Either_Sym0 a6989586621679433056 b6989586621679433058 c6989586621679433057) l Source # | |
data Either_Sym1 (l :: TyFun a6989586621679433056 c6989586621679433057 -> Type) (l :: TyFun (TyFun b6989586621679433058 c6989586621679433057 -> Type) (TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057 -> Type)) Source #
Instances
| SuppressUnusedWarnings ((TyFun a6989586621679433056 c6989586621679433057 -> Type) -> TyFun (TyFun b6989586621679433058 c6989586621679433057 -> Type) (TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057 -> Type) -> *) (Either_Sym1 a6989586621679433056 b6989586621679433058 c6989586621679433057) Source # | |
| type Apply (TyFun b6989586621679433058 c6989586621679433057 -> Type) (TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057 -> Type) (Either_Sym1 a6989586621679433056 b6989586621679433058 c6989586621679433057 l1) l2 Source # | |
data Either_Sym2 (l :: TyFun a6989586621679433056 c6989586621679433057 -> Type) (l :: TyFun b6989586621679433058 c6989586621679433057 -> Type) (l :: TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057) Source #
Instances
| SuppressUnusedWarnings ((TyFun a6989586621679433056 c6989586621679433057 -> Type) -> (TyFun b6989586621679433058 c6989586621679433057 -> Type) -> TyFun (Either a6989586621679433056 b6989586621679433058) c6989586621679433057 -> *) (Either_Sym2 a6989586621679433056 b6989586621679433058 c6989586621679433057) Source # | |
| type Apply (Either a b) c (Either_Sym2 a b c l1 l2) l3 Source # | |
type Either_Sym3 (t :: TyFun a6989586621679433056 c6989586621679433057 -> Type) (t :: TyFun b6989586621679433058 c6989586621679433057 -> Type) (t :: Either a6989586621679433056 b6989586621679433058) = Either_ t t t Source #
data LeftsSym0 (l :: TyFun [Either a6989586621679434168 b6989586621679434169] [a6989586621679434168]) Source #
data RightsSym0 (l :: TyFun [Either a6989586621679434166 b6989586621679434167] [b6989586621679434167]) Source #
Instances
| SuppressUnusedWarnings (TyFun [Either a6989586621679434166 b6989586621679434167] [b6989586621679434167] -> *) (RightsSym0 a6989586621679434166 b6989586621679434167) Source # | |
| type Apply [Either a b] [b] (RightsSym0 a b) l Source # | |
type RightsSym1 (t :: [Either a6989586621679434166 b6989586621679434167]) = Rights t Source #
data IsLeftSym0 (l :: TyFun (Either a6989586621679434162 b6989586621679434163) Bool) Source #
Instances
| SuppressUnusedWarnings (TyFun (Either a6989586621679434162 b6989586621679434163) Bool -> *) (IsLeftSym0 a6989586621679434162 b6989586621679434163) Source # | |
| type Apply (Either a b) Bool (IsLeftSym0 a b) l Source # | |
type IsLeftSym1 (t :: Either a6989586621679434162 b6989586621679434163) = IsLeft t Source #
data IsRightSym0 (l :: TyFun (Either a6989586621679434160 b6989586621679434161) Bool) Source #
Instances
| SuppressUnusedWarnings (TyFun (Either a6989586621679434160 b6989586621679434161) Bool -> *) (IsRightSym0 a6989586621679434160 b6989586621679434161) Source # | |
| type Apply (Either a b) Bool (IsRightSym0 a b) l Source # | |
type IsRightSym1 (t :: Either a6989586621679434160 b6989586621679434161) = IsRight t Source #