| 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.Maybe
Description
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.
- data family Sing (a :: k)
- type SMaybe = (Sing :: Maybe a -> Type)
- maybe_ :: forall b a. b -> (a -> b) -> Maybe a -> b
- type family Maybe_ (a :: b) (a :: TyFun a b -> Type) (a :: Maybe a) :: b where ...
- sMaybe_ :: forall t t t. Sing t -> Sing t -> Sing t -> Sing (Apply (Apply (Apply Maybe_Sym0 t) t) t :: b)
- type family IsJust (a :: Maybe a) :: Bool where ...
- sIsJust :: forall t. Sing t -> Sing (Apply IsJustSym0 t :: Bool)
- type family IsNothing (a :: Maybe a) :: Bool where ...
- sIsNothing :: forall t. Sing t -> Sing (Apply IsNothingSym0 t :: Bool)
- type family FromJust (a :: Maybe a) :: a where ...
- sFromJust :: forall t. Sing t -> Sing (Apply FromJustSym0 t :: a)
- type family FromMaybe (a :: a) (a :: Maybe a) :: a where ...
- sFromMaybe :: forall t t. Sing t -> Sing t -> Sing (Apply (Apply FromMaybeSym0 t) t :: a)
- type family ListToMaybe (a :: [a]) :: Maybe a where ...
- sListToMaybe :: forall t. Sing t -> Sing (Apply ListToMaybeSym0 t :: Maybe a)
- type family MaybeToList (a :: Maybe a) :: [a] where ...
- sMaybeToList :: forall t. Sing t -> Sing (Apply MaybeToListSym0 t :: [a])
- type family CatMaybes (a :: [Maybe a]) :: [a] where ...
- sCatMaybes :: forall t. Sing t -> Sing (Apply CatMaybesSym0 t :: [a])
- type family MapMaybe (a :: TyFun a (Maybe b) -> Type) (a :: [a]) :: [b] where ...
- sMapMaybe :: forall t t. Sing t -> Sing t -> Sing (Apply (Apply MapMaybeSym0 t) t :: [b])
- type NothingSym0 = Nothing
- data JustSym0 l
- type JustSym1 t = Just t
- data Maybe_Sym0 l
- data Maybe_Sym1 l l
- data Maybe_Sym2 l l l
- type Maybe_Sym3 t t t = Maybe_ t t t
- data IsJustSym0 l
- type IsJustSym1 t = IsJust t
- data IsNothingSym0 l
- type IsNothingSym1 t = IsNothing t
- data FromJustSym0 l
- type FromJustSym1 t = FromJust t
- data FromMaybeSym0 l
- data FromMaybeSym1 l l
- type FromMaybeSym2 t t = FromMaybe t t
- data ListToMaybeSym0 l
- type ListToMaybeSym1 t = ListToMaybe t
- data MaybeToListSym0 l
- type MaybeToListSym1 t = MaybeToList t
- data CatMaybesSym0 l
- type CatMaybesSym1 t = CatMaybes t
- data MapMaybeSym0 l
- data MapMaybeSym1 l l
- type MapMaybeSym2 t t = MapMaybe t t
Documentation
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
SNothing :: Sing Nothing SJust :: Sing a -> Sing (Just a)
Singletons from Data.Maybe
sMaybe_ :: forall t t t. 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 t. Sing t -> Sing (Apply IsNothingSym0 t :: Bool) Source #
type family FromMaybe (a :: a) (a :: Maybe a) :: a where ... Source #
Equations
| FromMaybe d x = Case_1627849137 d x x |
sFromMaybe :: forall t t. Sing t -> Sing t -> Sing (Apply (Apply FromMaybeSym0 t) t :: a) Source #
type family ListToMaybe (a :: [a]) :: Maybe a where ... Source #
Equations
| ListToMaybe '[] = NothingSym0 | |
| ListToMaybe ((:) a _z_1627849118) = Apply JustSym0 a |
sListToMaybe :: forall t. Sing t -> Sing (Apply ListToMaybeSym0 t :: Maybe a) Source #
type family MaybeToList (a :: Maybe a) :: [a] where ... Source #
Equations
| MaybeToList Nothing = '[] | |
| MaybeToList (Just x) = Apply (Apply (:$) x) '[] |
sMaybeToList :: forall t. Sing t -> Sing (Apply MaybeToListSym0 t :: [a]) Source #
sCatMaybes :: forall t. Sing t -> Sing (Apply CatMaybesSym0 t :: [a]) Source #
Defunctionalization symbols
type NothingSym0 = Nothing Source #
data Maybe_Sym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun b1627847771 (TyFun (TyFun a1627847772 b1627847771 -> Type) (TyFun (Maybe a1627847772) b1627847771 -> Type) -> Type) -> *) (Maybe_Sym0 a1627847772 b1627847771) Source # | |
| type Apply b1627847771 (TyFun (TyFun a1627847772 b1627847771 -> Type) (TyFun (Maybe a1627847772) b1627847771 -> Type) -> Type) (Maybe_Sym0 a1627847772 b1627847771) l0 Source # | |
data Maybe_Sym1 l l Source #
Instances
| SuppressUnusedWarnings (b1627847771 -> TyFun (TyFun a1627847772 b1627847771 -> Type) (TyFun (Maybe a1627847772) b1627847771 -> Type) -> *) (Maybe_Sym1 a1627847772 b1627847771) Source # | |
| type Apply (TyFun a1627847772 b1627847771 -> Type) (TyFun (Maybe a1627847772) b1627847771 -> Type) (Maybe_Sym1 a1627847772 b1627847771 l1) l0 Source # | |
data Maybe_Sym2 l l l Source #
Instances
| SuppressUnusedWarnings (b1627847771 -> (TyFun a1627847772 b1627847771 -> Type) -> TyFun (Maybe a1627847772) b1627847771 -> *) (Maybe_Sym2 a1627847772 b1627847771) Source # | |
| type Apply (Maybe a1627847772) b1627847771 (Maybe_Sym2 a1627847772 b1627847771 l1 l2) l0 Source # | |
type Maybe_Sym3 t t t = Maybe_ t t t Source #
data IsJustSym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun (Maybe a1627849036) Bool -> *) (IsJustSym0 a1627849036) Source # | |
| type Apply (Maybe a1627849036) Bool (IsJustSym0 a1627849036) l0 Source # | |
type IsJustSym1 t = IsJust t Source #
data IsNothingSym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun (Maybe a1627849035) Bool -> *) (IsNothingSym0 a1627849035) Source # | |
| type Apply (Maybe a1627849035) Bool (IsNothingSym0 a1627849035) l0 Source # | |
type IsNothingSym1 t = IsNothing t Source #
data FromJustSym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun (Maybe a1627849034) a1627849034 -> *) (FromJustSym0 a1627849034) Source # | |
| type Apply (Maybe a1627849034) a1627849034 (FromJustSym0 a1627849034) l0 Source # | |
type FromJustSym1 t = FromJust t Source #
data FromMaybeSym0 l Source #
data FromMaybeSym1 l l Source #
Instances
| SuppressUnusedWarnings (a1627849033 -> TyFun (Maybe a1627849033) a1627849033 -> *) (FromMaybeSym1 a1627849033) Source # | |
| type Apply (Maybe a1627849033) a1627849033 (FromMaybeSym1 a1627849033 l1) l0 Source # | |
type FromMaybeSym2 t t = FromMaybe t t Source #
data ListToMaybeSym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun [a1627849031] (Maybe a1627849031) -> *) (ListToMaybeSym0 a1627849031) Source # | |
| type Apply [a1627849031] (Maybe a1627849031) (ListToMaybeSym0 a1627849031) l0 Source # | |
type ListToMaybeSym1 t = ListToMaybe t Source #
data MaybeToListSym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun (Maybe a1627849032) [a1627849032] -> *) (MaybeToListSym0 a1627849032) Source # | |
| type Apply (Maybe a1627849032) [a1627849032] (MaybeToListSym0 a1627849032) l0 Source # | |
type MaybeToListSym1 t = MaybeToList t Source #
data CatMaybesSym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun [Maybe a1627849030] [a1627849030] -> *) (CatMaybesSym0 a1627849030) Source # | |
| type Apply [Maybe a1627849030] [a1627849030] (CatMaybesSym0 a1627849030) l0 Source # | |
type CatMaybesSym1 t = CatMaybes t Source #
data MapMaybeSym0 l Source #
Instances
| SuppressUnusedWarnings (TyFun (TyFun a1627849028 (Maybe b1627849029) -> Type) (TyFun [a1627849028] [b1627849029] -> Type) -> *) (MapMaybeSym0 a1627849028 b1627849029) Source # | |
| type Apply (TyFun a1627849028 (Maybe b1627849029) -> Type) (TyFun [a1627849028] [b1627849029] -> Type) (MapMaybeSym0 a1627849028 b1627849029) l0 Source # | |
data MapMaybeSym1 l l Source #
Instances
| SuppressUnusedWarnings ((TyFun a1627849028 (Maybe b1627849029) -> Type) -> TyFun [a1627849028] [b1627849029] -> *) (MapMaybeSym1 a1627849028 b1627849029) Source # | |
| type Apply [a1627849028] [b1627849029] (MapMaybeSym1 a1627849028 b1627849029 l1) l0 Source # | |
type MapMaybeSym2 t t = MapMaybe t t Source #