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 |
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_ :: b -> (a -> b) -> Maybe a -> b
- type family Maybe_ (a :: b) (a :: TyFun a b -> Type) (a :: Maybe a) :: b where ...
- sMaybe_ :: forall (t :: b) (t :: TyFun a b -> Type) (t :: Maybe a). 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 :: Maybe a). Sing t -> Sing (Apply IsJustSym0 t :: Bool)
- type family IsNothing (a :: Maybe a) :: Bool where ...
- sIsNothing :: forall (t :: Maybe a). Sing t -> Sing (Apply IsNothingSym0 t :: Bool)
- type family FromJust (a :: Maybe a) :: a where ...
- sFromJust :: forall (t :: Maybe a). Sing t -> Sing (Apply FromJustSym0 t :: a)
- type family FromMaybe (a :: a) (a :: Maybe a) :: a where ...
- sFromMaybe :: forall (t :: a) (t :: Maybe a). Sing t -> Sing t -> Sing (Apply (Apply FromMaybeSym0 t) t :: a)
- type family ListToMaybe (a :: [a]) :: Maybe a where ...
- sListToMaybe :: forall (t :: [a]). Sing t -> Sing (Apply ListToMaybeSym0 t :: Maybe a)
- type family MaybeToList (a :: Maybe a) :: [a] where ...
- sMaybeToList :: forall (t :: Maybe a). Sing t -> Sing (Apply MaybeToListSym0 t :: [a])
- type family CatMaybes (a :: [Maybe a]) :: [a] where ...
- sCatMaybes :: forall (t :: [Maybe a]). Sing t -> Sing (Apply CatMaybesSym0 t :: [a])
- type family MapMaybe (a :: TyFun a (Maybe b) -> Type) (a :: [a]) :: [b] where ...
- sMapMaybe :: forall (t :: TyFun a (Maybe b) -> Type) (t :: [a]). Sing t -> Sing t -> Sing (Apply (Apply MapMaybeSym0 t) t :: [b])
- type NothingSym0 = Nothing
- data JustSym0 (l :: TyFun a3530822107858468865 (Maybe a3530822107858468865))
- type JustSym1 (t :: a3530822107858468865) = Just t
- data Maybe_Sym0 (l :: TyFun b6989586621679423211 (TyFun (TyFun a6989586621679423212 b6989586621679423211 -> Type) (TyFun (Maybe a6989586621679423212) b6989586621679423211 -> Type) -> Type))
- data Maybe_Sym1 (l :: b6989586621679423211) (l :: TyFun (TyFun a6989586621679423212 b6989586621679423211 -> Type) (TyFun (Maybe a6989586621679423212) b6989586621679423211 -> Type))
- data Maybe_Sym2 (l :: b6989586621679423211) (l :: TyFun a6989586621679423212 b6989586621679423211 -> Type) (l :: TyFun (Maybe a6989586621679423212) b6989586621679423211)
- type Maybe_Sym3 (t :: b6989586621679423211) (t :: TyFun a6989586621679423212 b6989586621679423211 -> Type) (t :: Maybe a6989586621679423212) = Maybe_ t t t
- data IsJustSym0 (l :: TyFun (Maybe a6989586621679424324) Bool)
- type IsJustSym1 (t :: Maybe a6989586621679424324) = IsJust t
- data IsNothingSym0 (l :: TyFun (Maybe a6989586621679424323) Bool)
- type IsNothingSym1 (t :: Maybe a6989586621679424323) = IsNothing t
- data FromJustSym0 (l :: TyFun (Maybe a6989586621679424322) a6989586621679424322)
- type FromJustSym1 (t :: Maybe a6989586621679424322) = FromJust t
- data FromMaybeSym0 (l :: TyFun a6989586621679424321 (TyFun (Maybe a6989586621679424321) a6989586621679424321 -> Type))
- data FromMaybeSym1 (l :: a6989586621679424321) (l :: TyFun (Maybe a6989586621679424321) a6989586621679424321)
- type FromMaybeSym2 (t :: a6989586621679424321) (t :: Maybe a6989586621679424321) = FromMaybe t t
- data ListToMaybeSym0 (l :: TyFun [a6989586621679424319] (Maybe a6989586621679424319))
- type ListToMaybeSym1 (t :: [a6989586621679424319]) = ListToMaybe t
- data MaybeToListSym0 (l :: TyFun (Maybe a6989586621679424320) [a6989586621679424320])
- type MaybeToListSym1 (t :: Maybe a6989586621679424320) = MaybeToList t
- data CatMaybesSym0 (l :: TyFun [Maybe a6989586621679424318] [a6989586621679424318])
- type CatMaybesSym1 (t :: [Maybe a6989586621679424318]) = CatMaybes t
- data MapMaybeSym0 (l :: TyFun (TyFun a6989586621679424316 (Maybe b6989586621679424317) -> Type) (TyFun [a6989586621679424316] [b6989586621679424317] -> Type))
- data MapMaybeSym1 (l :: TyFun a6989586621679424316 (Maybe b6989586621679424317) -> Type) (l :: TyFun [a6989586621679424316] [b6989586621679424317])
- type MapMaybeSym2 (t :: TyFun a6989586621679424316 (Maybe b6989586621679424317) -> Type) (t :: [a6989586621679424316]) = MapMaybe t t
Documentation
data family Sing (a :: k) Source #
The singleton kind-indexed data family.
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
SNothing :: Sing Nothing SJust :: Sing a -> Sing (Just a)
Singletons from Data.Maybe
sMaybe_ :: forall (t :: b) (t :: TyFun a b -> Type) (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 (t :: Maybe a). Sing t -> Sing (Apply IsNothingSym0 t :: Bool) Source #
type family FromMaybe (a :: a) (a :: Maybe a) :: a where ... Source #
FromMaybe d x = Case_6989586621679424425 d x x |
sFromMaybe :: forall (t :: a) (t :: Maybe a). Sing t -> Sing t -> Sing (Apply (Apply FromMaybeSym0 t) t :: a) Source #
type family ListToMaybe (a :: [a]) :: Maybe a where ... Source #
ListToMaybe '[] = NothingSym0 | |
ListToMaybe ((:) a _z_6989586621679424406) = Apply JustSym0 a |
sListToMaybe :: forall (t :: [a]). Sing t -> Sing (Apply ListToMaybeSym0 t :: Maybe a) Source #
type family MaybeToList (a :: Maybe a) :: [a] where ... Source #
MaybeToList Nothing = '[] | |
MaybeToList (Just x) = Apply (Apply (:$) x) '[] |
sMaybeToList :: forall (t :: Maybe a). Sing t -> Sing (Apply MaybeToListSym0 t :: [a]) Source #
sCatMaybes :: forall (t :: [Maybe a]). Sing t -> Sing (Apply CatMaybesSym0 t :: [a]) Source #
sMapMaybe :: forall (t :: TyFun a (Maybe b) -> Type) (t :: [a]). Sing t -> Sing t -> Sing (Apply (Apply MapMaybeSym0 t) t :: [b]) Source #
Defunctionalization symbols
type NothingSym0 = Nothing Source #
data Maybe_Sym0 (l :: TyFun b6989586621679423211 (TyFun (TyFun a6989586621679423212 b6989586621679423211 -> Type) (TyFun (Maybe a6989586621679423212) b6989586621679423211 -> Type) -> Type)) Source #
SuppressUnusedWarnings (TyFun b6989586621679423211 (TyFun (TyFun a6989586621679423212 b6989586621679423211 -> Type) (TyFun (Maybe a6989586621679423212) b6989586621679423211 -> Type) -> Type) -> *) (Maybe_Sym0 a6989586621679423212 b6989586621679423211) Source # | |
type Apply b6989586621679423211 (TyFun (TyFun a6989586621679423212 b6989586621679423211 -> Type) (TyFun (Maybe a6989586621679423212) b6989586621679423211 -> Type) -> Type) (Maybe_Sym0 a6989586621679423212 b6989586621679423211) l Source # | |
data Maybe_Sym1 (l :: b6989586621679423211) (l :: TyFun (TyFun a6989586621679423212 b6989586621679423211 -> Type) (TyFun (Maybe a6989586621679423212) b6989586621679423211 -> Type)) Source #
SuppressUnusedWarnings (b6989586621679423211 -> TyFun (TyFun a6989586621679423212 b6989586621679423211 -> Type) (TyFun (Maybe a6989586621679423212) b6989586621679423211 -> Type) -> *) (Maybe_Sym1 a6989586621679423212 b6989586621679423211) Source # | |
type Apply (TyFun a6989586621679423212 b6989586621679423211 -> Type) (TyFun (Maybe a6989586621679423212) b6989586621679423211 -> Type) (Maybe_Sym1 a6989586621679423212 b6989586621679423211 l1) l2 Source # | |
data Maybe_Sym2 (l :: b6989586621679423211) (l :: TyFun a6989586621679423212 b6989586621679423211 -> Type) (l :: TyFun (Maybe a6989586621679423212) b6989586621679423211) Source #
SuppressUnusedWarnings (b6989586621679423211 -> (TyFun a6989586621679423212 b6989586621679423211 -> Type) -> TyFun (Maybe a6989586621679423212) b6989586621679423211 -> *) (Maybe_Sym2 a6989586621679423212 b6989586621679423211) Source # | |
type Apply (Maybe a) b (Maybe_Sym2 a b l1 l2) l3 Source # | |
type Maybe_Sym3 (t :: b6989586621679423211) (t :: TyFun a6989586621679423212 b6989586621679423211 -> Type) (t :: Maybe a6989586621679423212) = Maybe_ t t t Source #
data IsJustSym0 (l :: TyFun (Maybe a6989586621679424324) Bool) Source #
SuppressUnusedWarnings (TyFun (Maybe a6989586621679424324) Bool -> *) (IsJustSym0 a6989586621679424324) Source # | |
type Apply (Maybe a) Bool (IsJustSym0 a) l Source # | |
type IsJustSym1 (t :: Maybe a6989586621679424324) = IsJust t Source #
data IsNothingSym0 (l :: TyFun (Maybe a6989586621679424323) Bool) Source #
SuppressUnusedWarnings (TyFun (Maybe a6989586621679424323) Bool -> *) (IsNothingSym0 a6989586621679424323) Source # | |
type Apply (Maybe a) Bool (IsNothingSym0 a) l Source # | |
type IsNothingSym1 (t :: Maybe a6989586621679424323) = IsNothing t Source #
data FromJustSym0 (l :: TyFun (Maybe a6989586621679424322) a6989586621679424322) Source #
SuppressUnusedWarnings (TyFun (Maybe a6989586621679424322) a6989586621679424322 -> *) (FromJustSym0 a6989586621679424322) Source # | |
type Apply (Maybe a) a (FromJustSym0 a) l Source # | |
type FromJustSym1 (t :: Maybe a6989586621679424322) = FromJust t Source #
data FromMaybeSym0 (l :: TyFun a6989586621679424321 (TyFun (Maybe a6989586621679424321) a6989586621679424321 -> Type)) Source #
SuppressUnusedWarnings (TyFun a6989586621679424321 (TyFun (Maybe a6989586621679424321) a6989586621679424321 -> Type) -> *) (FromMaybeSym0 a6989586621679424321) Source # | |
type Apply a6989586621679424321 (TyFun (Maybe a6989586621679424321) a6989586621679424321 -> Type) (FromMaybeSym0 a6989586621679424321) l Source # | |
data FromMaybeSym1 (l :: a6989586621679424321) (l :: TyFun (Maybe a6989586621679424321) a6989586621679424321) Source #
SuppressUnusedWarnings (a6989586621679424321 -> TyFun (Maybe a6989586621679424321) a6989586621679424321 -> *) (FromMaybeSym1 a6989586621679424321) Source # | |
type Apply (Maybe a) a (FromMaybeSym1 a l1) l2 Source # | |
type FromMaybeSym2 (t :: a6989586621679424321) (t :: Maybe a6989586621679424321) = FromMaybe t t Source #
data ListToMaybeSym0 (l :: TyFun [a6989586621679424319] (Maybe a6989586621679424319)) Source #
SuppressUnusedWarnings (TyFun [a6989586621679424319] (Maybe a6989586621679424319) -> *) (ListToMaybeSym0 a6989586621679424319) Source # | |
type Apply [a] (Maybe a) (ListToMaybeSym0 a) l Source # | |
type ListToMaybeSym1 (t :: [a6989586621679424319]) = ListToMaybe t Source #
data MaybeToListSym0 (l :: TyFun (Maybe a6989586621679424320) [a6989586621679424320]) Source #
SuppressUnusedWarnings (TyFun (Maybe a6989586621679424320) [a6989586621679424320] -> *) (MaybeToListSym0 a6989586621679424320) Source # | |
type Apply (Maybe a) [a] (MaybeToListSym0 a) l Source # | |
type MaybeToListSym1 (t :: Maybe a6989586621679424320) = MaybeToList t Source #
data CatMaybesSym0 (l :: TyFun [Maybe a6989586621679424318] [a6989586621679424318]) Source #
SuppressUnusedWarnings (TyFun [Maybe a6989586621679424318] [a6989586621679424318] -> *) (CatMaybesSym0 a6989586621679424318) Source # | |
type Apply [Maybe a] [a] (CatMaybesSym0 a) l Source # | |
type CatMaybesSym1 (t :: [Maybe a6989586621679424318]) = CatMaybes t Source #
data MapMaybeSym0 (l :: TyFun (TyFun a6989586621679424316 (Maybe b6989586621679424317) -> Type) (TyFun [a6989586621679424316] [b6989586621679424317] -> Type)) Source #
SuppressUnusedWarnings (TyFun (TyFun a6989586621679424316 (Maybe b6989586621679424317) -> Type) (TyFun [a6989586621679424316] [b6989586621679424317] -> Type) -> *) (MapMaybeSym0 a6989586621679424316 b6989586621679424317) Source # | |
type Apply (TyFun a6989586621679424316 (Maybe b6989586621679424317) -> Type) (TyFun [a6989586621679424316] [b6989586621679424317] -> Type) (MapMaybeSym0 a6989586621679424316 b6989586621679424317) l Source # | |
data MapMaybeSym1 (l :: TyFun a6989586621679424316 (Maybe b6989586621679424317) -> Type) (l :: TyFun [a6989586621679424316] [b6989586621679424317]) Source #
SuppressUnusedWarnings ((TyFun a6989586621679424316 (Maybe b6989586621679424317) -> Type) -> TyFun [a6989586621679424316] [b6989586621679424317] -> *) (MapMaybeSym1 a6989586621679424316 b6989586621679424317) Source # | |
type Apply [a] [b] (MapMaybeSym1 a b l1) l2 Source # | |