Copyright | (C) 2013-2014 Richard Eisenberg Jan Stolarek |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | Ryan Scott |
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.
Synopsis
- type family Sing
- data SEither z where
- either_ :: (a -> c) -> (b -> c) -> Either a b -> c
- type family Either_ a a a where ...
- sEither_ :: forall a c b (t :: (~>) a c) (t :: (~>) b c) (t :: Either a b). Sing t -> Sing t -> Sing t -> Sing (Apply (Apply (Apply Either_Sym0 t) t) t :: c)
- type family Lefts a where ...
- sLefts :: forall a b (t :: [Either a b]). Sing t -> Sing (Apply LeftsSym0 t :: [a])
- type family Rights a where ...
- sRights :: forall a b (t :: [Either a b]). Sing t -> Sing (Apply RightsSym0 t :: [b])
- type family PartitionEithers a where ...
- sPartitionEithers :: forall a b (t :: [Either a b]). Sing t -> Sing (Apply PartitionEithersSym0 t :: ([a], [b]))
- type family IsLeft a where ...
- sIsLeft :: forall a b (t :: Either a b). Sing t -> Sing (Apply IsLeftSym0 t :: Bool)
- type family IsRight a where ...
- sIsRight :: forall a b (t :: Either a b). Sing t -> Sing (Apply IsRightSym0 t :: Bool)
- data LeftSym0 a6989586621679304182
- type LeftSym1 (a6989586621679304182 :: a) = 'Left a6989586621679304182 :: Either (a :: Type) (b :: Type)
- data RightSym0 a6989586621679304184
- type RightSym1 (a6989586621679304184 :: b) = 'Right a6989586621679304184 :: Either (a :: Type) (b :: Type)
- data Either_Sym0 a6989586621680470389
- data Either_Sym1 a6989586621680470389 a6989586621680470390
- data Either_Sym2 a6989586621680470389 a6989586621680470390 a6989586621680470391
- type Either_Sym3 (a6989586621680470389 :: (~>) a c) (a6989586621680470390 :: (~>) b c) (a6989586621680470391 :: Either a b) = Either_ a6989586621680470389 a6989586621680470390 a6989586621680470391 :: c
- data LeftsSym0 a6989586621680472085
- type LeftsSym1 (a6989586621680472085 :: [Either a b]) = Lefts a6989586621680472085 :: [a]
- data RightsSym0 a6989586621680472079
- type RightsSym1 (a6989586621680472079 :: [Either a b]) = Rights a6989586621680472079 :: [b]
- data IsLeftSym0 a6989586621680472057
- type IsLeftSym1 (a6989586621680472057 :: Either a b) = IsLeft a6989586621680472057 :: Bool
- data IsRightSym0 a6989586621680472054
- type IsRightSym1 (a6989586621680472054 :: Either a b) = IsRight a6989586621680472054 :: Bool
The Either
singleton
The singleton kind-indexed type family.
Instances
SLeft :: forall (a :: Type) (b :: Type) (n :: a). (Sing n) -> SEither ('Left n :: Either (a :: Type) (b :: Type)) | |
SRight :: forall (a :: Type) (b :: Type) (n :: b). (Sing n) -> SEither ('Right n :: Either (a :: Type) (b :: Type)) |
Instances
(SDecide a, SDecide b) => TestCoercion (SEither :: Either a b -> Type) Source # | |
Defined in Data.Singletons.Prelude.Instances | |
(SDecide a, SDecide b) => TestEquality (SEither :: Either a b -> Type) Source # | |
Defined in Data.Singletons.Prelude.Instances | |
(ShowSing a, ShowSing b) => Show (SEither z) Source # | |
Singletons from Data.Either
sEither_ :: forall a c b (t :: (~>) a c) (t :: (~>) b c) (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 where ... Source #
PartitionEithers a_6989586621680472058 = Apply (Apply (Apply FoldrSym0 (Apply (Apply Either_Sym0 (Let6989586621680472064LeftSym1 a_6989586621680472058)) (Let6989586621680472064RightSym1 a_6989586621680472058))) (Apply (Apply Tuple2Sym0 NilSym0) NilSym0)) a_6989586621680472058 |
sPartitionEithers :: forall a b (t :: [Either a b]). Sing t -> Sing (Apply PartitionEithersSym0 t :: ([a], [b])) Source #
Defunctionalization symbols
data LeftSym0 a6989586621679304182 Source #
Instances
SingI (LeftSym0 :: TyFun a (Either a b) -> Type) Source # | |
SuppressUnusedWarnings (LeftSym0 :: TyFun a (Either a b) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Instances suppressUnusedWarnings :: () Source # | |
type Apply (LeftSym0 :: TyFun a (Either a b) -> Type) (a6989586621679304182 :: a) Source # | |
type LeftSym1 (a6989586621679304182 :: a) = 'Left a6989586621679304182 :: Either (a :: Type) (b :: Type) Source #
data RightSym0 a6989586621679304184 Source #
Instances
SingI (RightSym0 :: TyFun b (Either a b) -> Type) Source # | |
SuppressUnusedWarnings (RightSym0 :: TyFun b (Either a b) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Instances suppressUnusedWarnings :: () Source # | |
type Apply (RightSym0 :: TyFun b (Either a b) -> Type) (a6989586621679304184 :: b) Source # | |
type RightSym1 (a6989586621679304184 :: b) = 'Right a6989586621679304184 :: Either (a :: Type) (b :: Type) Source #
data Either_Sym0 a6989586621680470389 Source #
Instances
SingI (Either_Sym0 :: TyFun (a ~> c) ((b ~> c) ~> (Either a b ~> c)) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either sing :: Sing Either_Sym0 Source # | |
SuppressUnusedWarnings (Either_Sym0 :: TyFun (a ~> c) ((b ~> c) ~> (Either a b ~> c)) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either suppressUnusedWarnings :: () Source # | |
type Apply (Either_Sym0 :: TyFun (a ~> c) ((b ~> c) ~> (Either a b ~> c)) -> Type) (a6989586621680470389 :: a ~> c) Source # | |
data Either_Sym1 a6989586621680470389 a6989586621680470390 Source #
Instances
SingI d => SingI (Either_Sym1 d :: TyFun (b ~> c) (Either a b ~> c) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either sing :: Sing (Either_Sym1 d) Source # | |
SuppressUnusedWarnings (Either_Sym1 a6989586621680470389 :: TyFun (b ~> c) (Either a b ~> c) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either suppressUnusedWarnings :: () Source # | |
type Apply (Either_Sym1 a6989586621680470389 :: TyFun (b ~> c) (Either a b ~> c) -> Type) (a6989586621680470390 :: b ~> c) Source # | |
Defined in Data.Singletons.Prelude.Either type Apply (Either_Sym1 a6989586621680470389 :: TyFun (b ~> c) (Either a b ~> c) -> Type) (a6989586621680470390 :: b ~> c) = Either_Sym2 a6989586621680470389 a6989586621680470390 |
data Either_Sym2 a6989586621680470389 a6989586621680470390 a6989586621680470391 Source #
Instances
(SingI d1, SingI d2) => SingI (Either_Sym2 d1 d2 :: TyFun (Either a b) c -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either sing :: Sing (Either_Sym2 d1 d2) Source # | |
SuppressUnusedWarnings (Either_Sym2 a6989586621680470389 a6989586621680470390 :: TyFun (Either a b) c -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either suppressUnusedWarnings :: () Source # | |
type Apply (Either_Sym2 a6989586621680470389 a6989586621680470390 :: TyFun (Either a b) c -> Type) (a6989586621680470391 :: Either a b) Source # | |
Defined in Data.Singletons.Prelude.Either type Apply (Either_Sym2 a6989586621680470389 a6989586621680470390 :: TyFun (Either a b) c -> Type) (a6989586621680470391 :: Either a b) = Either_Sym3 a6989586621680470389 a6989586621680470390 a6989586621680470391 |
type Either_Sym3 (a6989586621680470389 :: (~>) a c) (a6989586621680470390 :: (~>) b c) (a6989586621680470391 :: Either a b) = Either_ a6989586621680470389 a6989586621680470390 a6989586621680470391 :: c Source #
data LeftsSym0 a6989586621680472085 Source #
Instances
SingI (LeftsSym0 :: TyFun [Either a b] [a] -> Type) Source # | |
SuppressUnusedWarnings (LeftsSym0 :: TyFun [Either a b] [a] -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either suppressUnusedWarnings :: () Source # | |
type Apply (LeftsSym0 :: TyFun [Either a b] [a] -> Type) (a6989586621680472085 :: [Either a b]) Source # | |
data RightsSym0 a6989586621680472079 Source #
Instances
SingI (RightsSym0 :: TyFun [Either a b] [b] -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either sing :: Sing RightsSym0 Source # | |
SuppressUnusedWarnings (RightsSym0 :: TyFun [Either a b] [b] -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either suppressUnusedWarnings :: () Source # | |
type Apply (RightsSym0 :: TyFun [Either a b] [b] -> Type) (a6989586621680472079 :: [Either a b]) Source # | |
Defined in Data.Singletons.Prelude.Either type Apply (RightsSym0 :: TyFun [Either a b] [b] -> Type) (a6989586621680472079 :: [Either a b]) = RightsSym1 a6989586621680472079 |
type RightsSym1 (a6989586621680472079 :: [Either a b]) = Rights a6989586621680472079 :: [b] Source #
data IsLeftSym0 a6989586621680472057 Source #
Instances
SingI (IsLeftSym0 :: TyFun (Either a b) Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either sing :: Sing IsLeftSym0 Source # | |
SuppressUnusedWarnings (IsLeftSym0 :: TyFun (Either a b) Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either suppressUnusedWarnings :: () Source # | |
type Apply (IsLeftSym0 :: TyFun (Either a b) Bool -> Type) (a6989586621680472057 :: Either a b) Source # | |
Defined in Data.Singletons.Prelude.Either type Apply (IsLeftSym0 :: TyFun (Either a b) Bool -> Type) (a6989586621680472057 :: Either a b) = IsLeftSym1 a6989586621680472057 |
data IsRightSym0 a6989586621680472054 Source #
Instances
SingI (IsRightSym0 :: TyFun (Either a b) Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either sing :: Sing IsRightSym0 Source # | |
SuppressUnusedWarnings (IsRightSym0 :: TyFun (Either a b) Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Either suppressUnusedWarnings :: () Source # | |
type Apply (IsRightSym0 :: TyFun (Either a b) Bool -> Type) (a6989586621680472054 :: Either a b) Source # | |
Defined in Data.Singletons.Prelude.Either type Apply (IsRightSym0 :: TyFun (Either a b) Bool -> Type) (a6989586621680472054 :: Either a b) = IsRightSym1 a6989586621680472054 |