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 Maybe
,
including a singletons version of all the definitions in Data.Maybe
.
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.Maybe
. Also, please excuse
the apparent repeated variable names. This is due to an interaction
between Template Haskell and Haddock.
Synopsis
- type family Sing
- data SMaybe z where
- maybe_ :: b -> (a -> b) -> Maybe a -> b
- type family Maybe_ a a a where ...
- sMaybe_ :: forall b a (t :: b) (t :: (~>) a b) (t :: Maybe a). Sing t -> Sing t -> Sing t -> Sing (Apply (Apply (Apply Maybe_Sym0 t) t) t :: b)
- type family IsJust a where ...
- sIsJust :: forall a (t :: Maybe a). Sing t -> Sing (Apply IsJustSym0 t :: Bool)
- type family IsNothing a where ...
- sIsNothing :: forall a (t :: Maybe a). Sing t -> Sing (Apply IsNothingSym0 t :: Bool)
- type family FromJust a where ...
- sFromJust :: forall a (t :: Maybe a). Sing t -> Sing (Apply FromJustSym0 t :: a)
- type family FromMaybe a a where ...
- sFromMaybe :: forall a (t :: a) (t :: Maybe a). Sing t -> Sing t -> Sing (Apply (Apply FromMaybeSym0 t) t :: a)
- type family ListToMaybe a where ...
- sListToMaybe :: forall a (t :: [a]). Sing t -> Sing (Apply ListToMaybeSym0 t :: Maybe a)
- type family MaybeToList a where ...
- sMaybeToList :: forall a (t :: Maybe a). Sing t -> Sing (Apply MaybeToListSym0 t :: [a])
- type family CatMaybes a where ...
- sCatMaybes :: forall a (t :: [Maybe a]). Sing t -> Sing (Apply CatMaybesSym0 t :: [a])
- type family MapMaybe a a where ...
- sMapMaybe :: forall a b (t :: (~>) a (Maybe b)) (t :: [a]). Sing t -> Sing t -> Sing (Apply (Apply MapMaybeSym0 t) t :: [b])
- type NothingSym0 = 'Nothing :: Maybe (a :: Type)
- data JustSym0 a6989586621679304113
- type JustSym1 (a6989586621679304113 :: a) = 'Just a6989586621679304113 :: Maybe (a :: Type)
- data Maybe_Sym0 a6989586621679500654
- data Maybe_Sym1 a6989586621679500654 a6989586621679500655
- data Maybe_Sym2 a6989586621679500654 a6989586621679500655 a6989586621679500656
- type Maybe_Sym3 (a6989586621679500654 :: b) (a6989586621679500655 :: (~>) a b) (a6989586621679500656 :: Maybe a) = Maybe_ a6989586621679500654 a6989586621679500655 a6989586621679500656 :: b
- data IsJustSym0 a6989586621679502239
- type IsJustSym1 (a6989586621679502239 :: Maybe a) = IsJust a6989586621679502239 :: Bool
- data IsNothingSym0 a6989586621679502236
- type IsNothingSym1 (a6989586621679502236 :: Maybe a) = IsNothing a6989586621679502236 :: Bool
- data FromJustSym0 a6989586621679502232
- type FromJustSym1 (a6989586621679502232 :: Maybe a) = FromJust a6989586621679502232 :: a
- data FromMaybeSym0 a6989586621679502222
- data FromMaybeSym1 a6989586621679502222 a6989586621679502223
- type FromMaybeSym2 (a6989586621679502222 :: a) (a6989586621679502223 :: Maybe a) = FromMaybe a6989586621679502222 a6989586621679502223 :: a
- data ListToMaybeSym0 a6989586621679502213
- type ListToMaybeSym1 (a6989586621679502213 :: [a]) = ListToMaybe a6989586621679502213 :: Maybe a
- data MaybeToListSym0 a6989586621679502217
- type MaybeToListSym1 (a6989586621679502217 :: Maybe a) = MaybeToList a6989586621679502217 :: [a]
- data CatMaybesSym0 a6989586621679502207
- type CatMaybesSym1 (a6989586621679502207 :: [Maybe a]) = CatMaybes a6989586621679502207 :: [a]
- data MapMaybeSym0 a6989586621679502192
- data MapMaybeSym1 a6989586621679502192 a6989586621679502193
- type MapMaybeSym2 (a6989586621679502192 :: (~>) a (Maybe b)) (a6989586621679502193 :: [a]) = MapMaybe a6989586621679502192 a6989586621679502193 :: [b]
Documentation
The singleton kind-indexed type family.
Instances
SNothing :: forall (a :: Type). SMaybe ('Nothing :: Maybe (a :: Type)) | |
SJust :: forall (a :: Type) (n :: a). (Sing n) -> SMaybe ('Just n :: Maybe (a :: Type)) |
Singletons from Data.Maybe
sMaybe_ :: forall b a (t :: b) (t :: (~>) a b) (t :: Maybe a). Sing t -> Sing t -> Sing t -> Sing (Apply (Apply (Apply Maybe_Sym0 t) t) t :: b) Source #
The preceding two definitions are derived from the function maybe
in
Data.Maybe
. The extra underscore is to avoid name clashes with the type
Maybe
.
sIsNothing :: forall a (t :: Maybe a). Sing t -> Sing (Apply IsNothingSym0 t :: Bool) Source #
sFromMaybe :: forall a (t :: a) (t :: Maybe a). Sing t -> Sing t -> Sing (Apply (Apply FromMaybeSym0 t) t :: a) Source #
type family ListToMaybe a where ... Source #
ListToMaybe '[] = NothingSym0 | |
ListToMaybe ('(:) a _) = Apply JustSym0 a |
sListToMaybe :: forall a (t :: [a]). Sing t -> Sing (Apply ListToMaybeSym0 t :: Maybe a) Source #
type family MaybeToList a where ... Source #
MaybeToList 'Nothing = NilSym0 | |
MaybeToList ('Just x) = Apply (Apply (:@#@$) x) NilSym0 |
sMaybeToList :: forall a (t :: Maybe a). Sing t -> Sing (Apply MaybeToListSym0 t :: [a]) Source #
sCatMaybes :: forall a (t :: [Maybe a]). Sing t -> Sing (Apply CatMaybesSym0 t :: [a]) Source #
sMapMaybe :: forall a b (t :: (~>) a (Maybe b)) (t :: [a]). Sing t -> Sing t -> Sing (Apply (Apply MapMaybeSym0 t) t :: [b]) Source #
Defunctionalization symbols
data JustSym0 a6989586621679304113 Source #
Instances
type JustSym1 (a6989586621679304113 :: a) = 'Just a6989586621679304113 :: Maybe (a :: Type) Source #
data Maybe_Sym0 a6989586621679500654 Source #
Instances
SingI (Maybe_Sym0 :: TyFun b ((a ~> b) ~> (Maybe a ~> b)) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing Maybe_Sym0 Source # | |
SuppressUnusedWarnings (Maybe_Sym0 :: TyFun b ((a ~> b) ~> (Maybe a ~> b)) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (Maybe_Sym0 :: TyFun b ((a ~> b) ~> (Maybe a ~> b)) -> Type) (a6989586621679500654 :: b) Source # | |
Defined in Data.Singletons.Prelude.Maybe |
data Maybe_Sym1 a6989586621679500654 a6989586621679500655 Source #
Instances
SingI d => SingI (Maybe_Sym1 d :: TyFun (a ~> b) (Maybe a ~> b) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing (Maybe_Sym1 d) Source # | |
SuppressUnusedWarnings (Maybe_Sym1 a6989586621679500654 :: TyFun (a ~> b) (Maybe a ~> b) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (Maybe_Sym1 a6989586621679500654 :: TyFun (a ~> b) (Maybe a ~> b) -> Type) (a6989586621679500655 :: a ~> b) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (Maybe_Sym1 a6989586621679500654 :: TyFun (a ~> b) (Maybe a ~> b) -> Type) (a6989586621679500655 :: a ~> b) = Maybe_Sym2 a6989586621679500654 a6989586621679500655 |
data Maybe_Sym2 a6989586621679500654 a6989586621679500655 a6989586621679500656 Source #
Instances
(SingI d1, SingI d2) => SingI (Maybe_Sym2 d1 d2 :: TyFun (Maybe a) b -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing (Maybe_Sym2 d1 d2) Source # | |
SuppressUnusedWarnings (Maybe_Sym2 a6989586621679500654 a6989586621679500655 :: TyFun (Maybe a) b -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (Maybe_Sym2 a6989586621679500654 a6989586621679500655 :: TyFun (Maybe a) b -> Type) (a6989586621679500656 :: Maybe a) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (Maybe_Sym2 a6989586621679500654 a6989586621679500655 :: TyFun (Maybe a) b -> Type) (a6989586621679500656 :: Maybe a) = Maybe_Sym3 a6989586621679500654 a6989586621679500655 a6989586621679500656 |
type Maybe_Sym3 (a6989586621679500654 :: b) (a6989586621679500655 :: (~>) a b) (a6989586621679500656 :: Maybe a) = Maybe_ a6989586621679500654 a6989586621679500655 a6989586621679500656 :: b Source #
data IsJustSym0 a6989586621679502239 Source #
Instances
SingI (IsJustSym0 :: TyFun (Maybe a) Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing IsJustSym0 Source # | |
SuppressUnusedWarnings (IsJustSym0 :: TyFun (Maybe a) Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (IsJustSym0 :: TyFun (Maybe a) Bool -> Type) (a6989586621679502239 :: Maybe a) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (IsJustSym0 :: TyFun (Maybe a) Bool -> Type) (a6989586621679502239 :: Maybe a) = IsJustSym1 a6989586621679502239 |
data IsNothingSym0 a6989586621679502236 Source #
Instances
SingI (IsNothingSym0 :: TyFun (Maybe a) Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing IsNothingSym0 Source # | |
SuppressUnusedWarnings (IsNothingSym0 :: TyFun (Maybe a) Bool -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (IsNothingSym0 :: TyFun (Maybe a) Bool -> Type) (a6989586621679502236 :: Maybe a) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (IsNothingSym0 :: TyFun (Maybe a) Bool -> Type) (a6989586621679502236 :: Maybe a) = IsNothingSym1 a6989586621679502236 |
type IsNothingSym1 (a6989586621679502236 :: Maybe a) = IsNothing a6989586621679502236 :: Bool Source #
data FromJustSym0 a6989586621679502232 Source #
Instances
SingI (FromJustSym0 :: TyFun (Maybe a) a -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing FromJustSym0 Source # | |
SuppressUnusedWarnings (FromJustSym0 :: TyFun (Maybe a) a -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (FromJustSym0 :: TyFun (Maybe a) a -> Type) (a6989586621679502232 :: Maybe a) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (FromJustSym0 :: TyFun (Maybe a) a -> Type) (a6989586621679502232 :: Maybe a) = FromJustSym1 a6989586621679502232 |
type FromJustSym1 (a6989586621679502232 :: Maybe a) = FromJust a6989586621679502232 :: a Source #
data FromMaybeSym0 a6989586621679502222 Source #
Instances
SingI (FromMaybeSym0 :: TyFun a (Maybe a ~> a) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing FromMaybeSym0 Source # | |
SuppressUnusedWarnings (FromMaybeSym0 :: TyFun a (Maybe a ~> a) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (FromMaybeSym0 :: TyFun a (Maybe a ~> a) -> Type) (a6989586621679502222 :: a) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (FromMaybeSym0 :: TyFun a (Maybe a ~> a) -> Type) (a6989586621679502222 :: a) = FromMaybeSym1 a6989586621679502222 |
data FromMaybeSym1 a6989586621679502222 a6989586621679502223 Source #
Instances
SingI d => SingI (FromMaybeSym1 d :: TyFun (Maybe a) a -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing (FromMaybeSym1 d) Source # | |
SuppressUnusedWarnings (FromMaybeSym1 a6989586621679502222 :: TyFun (Maybe a) a -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (FromMaybeSym1 a6989586621679502222 :: TyFun (Maybe a) a -> Type) (a6989586621679502223 :: Maybe a) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (FromMaybeSym1 a6989586621679502222 :: TyFun (Maybe a) a -> Type) (a6989586621679502223 :: Maybe a) = FromMaybeSym2 a6989586621679502222 a6989586621679502223 |
type FromMaybeSym2 (a6989586621679502222 :: a) (a6989586621679502223 :: Maybe a) = FromMaybe a6989586621679502222 a6989586621679502223 :: a Source #
data ListToMaybeSym0 a6989586621679502213 Source #
Instances
SingI (ListToMaybeSym0 :: TyFun [a] (Maybe a) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe | |
SuppressUnusedWarnings (ListToMaybeSym0 :: TyFun [a] (Maybe a) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (ListToMaybeSym0 :: TyFun [a] (Maybe a) -> Type) (a6989586621679502213 :: [a]) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (ListToMaybeSym0 :: TyFun [a] (Maybe a) -> Type) (a6989586621679502213 :: [a]) = ListToMaybeSym1 a6989586621679502213 |
type ListToMaybeSym1 (a6989586621679502213 :: [a]) = ListToMaybe a6989586621679502213 :: Maybe a Source #
data MaybeToListSym0 a6989586621679502217 Source #
Instances
SingI (MaybeToListSym0 :: TyFun (Maybe a) [a] -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe | |
SuppressUnusedWarnings (MaybeToListSym0 :: TyFun (Maybe a) [a] -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (MaybeToListSym0 :: TyFun (Maybe a) [a] -> Type) (a6989586621679502217 :: Maybe a) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (MaybeToListSym0 :: TyFun (Maybe a) [a] -> Type) (a6989586621679502217 :: Maybe a) = MaybeToListSym1 a6989586621679502217 |
type MaybeToListSym1 (a6989586621679502217 :: Maybe a) = MaybeToList a6989586621679502217 :: [a] Source #
data CatMaybesSym0 a6989586621679502207 Source #
Instances
SingI (CatMaybesSym0 :: TyFun [Maybe a] [a] -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing CatMaybesSym0 Source # | |
SuppressUnusedWarnings (CatMaybesSym0 :: TyFun [Maybe a] [a] -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (CatMaybesSym0 :: TyFun [Maybe a] [a] -> Type) (a6989586621679502207 :: [Maybe a]) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (CatMaybesSym0 :: TyFun [Maybe a] [a] -> Type) (a6989586621679502207 :: [Maybe a]) = CatMaybesSym1 a6989586621679502207 |
type CatMaybesSym1 (a6989586621679502207 :: [Maybe a]) = CatMaybes a6989586621679502207 :: [a] Source #
data MapMaybeSym0 a6989586621679502192 Source #
Instances
SingI (MapMaybeSym0 :: TyFun (a ~> Maybe b) ([a] ~> [b]) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing MapMaybeSym0 Source # | |
SuppressUnusedWarnings (MapMaybeSym0 :: TyFun (a ~> Maybe b) ([a] ~> [b]) -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (MapMaybeSym0 :: TyFun (a ~> Maybe b) ([a] ~> [b]) -> Type) (a6989586621679502192 :: a ~> Maybe b) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (MapMaybeSym0 :: TyFun (a ~> Maybe b) ([a] ~> [b]) -> Type) (a6989586621679502192 :: a ~> Maybe b) = MapMaybeSym1 a6989586621679502192 |
data MapMaybeSym1 a6989586621679502192 a6989586621679502193 Source #
Instances
SingI d => SingI (MapMaybeSym1 d :: TyFun [a] [b] -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe sing :: Sing (MapMaybeSym1 d) Source # | |
SuppressUnusedWarnings (MapMaybeSym1 a6989586621679502192 :: TyFun [a] [b] -> Type) Source # | |
Defined in Data.Singletons.Prelude.Maybe suppressUnusedWarnings :: () Source # | |
type Apply (MapMaybeSym1 a6989586621679502192 :: TyFun [a] [b] -> Type) (a6989586621679502193 :: [a]) Source # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (MapMaybeSym1 a6989586621679502192 :: TyFun [a] [b] -> Type) (a6989586621679502193 :: [a]) = MapMaybeSym2 a6989586621679502192 a6989586621679502193 |