| 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.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.
Synopsis
- 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 b6989586621679418662 (TyFun (TyFun a6989586621679418663 b6989586621679418662 -> Type) (TyFun (Maybe a6989586621679418663) b6989586621679418662 -> Type) -> Type))
- data Maybe_Sym1 (l :: b6989586621679418662) (l :: TyFun (TyFun a6989586621679418663 b6989586621679418662 -> Type) (TyFun (Maybe a6989586621679418663) b6989586621679418662 -> Type))
- data Maybe_Sym2 (l :: b6989586621679418662) (l :: TyFun a6989586621679418663 b6989586621679418662 -> Type) (l :: TyFun (Maybe a6989586621679418663) b6989586621679418662)
- type Maybe_Sym3 (t :: b6989586621679418662) (t :: TyFun a6989586621679418663 b6989586621679418662 -> Type) (t :: Maybe a6989586621679418663) = Maybe_ t t t
- data IsJustSym0 (l :: TyFun (Maybe a6989586621679419783) Bool)
- type IsJustSym1 (t :: Maybe a6989586621679419783) = IsJust t
- data IsNothingSym0 (l :: TyFun (Maybe a6989586621679419782) Bool)
- type IsNothingSym1 (t :: Maybe a6989586621679419782) = IsNothing t
- data FromJustSym0 (l :: TyFun (Maybe a6989586621679419781) a6989586621679419781)
- type FromJustSym1 (t :: Maybe a6989586621679419781) = FromJust t
- data FromMaybeSym0 (l :: TyFun a6989586621679419780 (TyFun (Maybe a6989586621679419780) a6989586621679419780 -> Type))
- data FromMaybeSym1 (l :: a6989586621679419780) (l :: TyFun (Maybe a6989586621679419780) a6989586621679419780)
- type FromMaybeSym2 (t :: a6989586621679419780) (t :: Maybe a6989586621679419780) = FromMaybe t t
- data ListToMaybeSym0 (l :: TyFun [a6989586621679419778] (Maybe a6989586621679419778))
- type ListToMaybeSym1 (t :: [a6989586621679419778]) = ListToMaybe t
- data MaybeToListSym0 (l :: TyFun (Maybe a6989586621679419779) [a6989586621679419779])
- type MaybeToListSym1 (t :: Maybe a6989586621679419779) = MaybeToList t
- data CatMaybesSym0 (l :: TyFun [Maybe a6989586621679419777] [a6989586621679419777])
- type CatMaybesSym1 (t :: [Maybe a6989586621679419777]) = CatMaybes t
- data MapMaybeSym0 (l :: TyFun (TyFun a6989586621679419775 (Maybe b6989586621679419776) -> Type) (TyFun [a6989586621679419775] [b6989586621679419776] -> Type))
- data MapMaybeSym1 (l :: TyFun a6989586621679419775 (Maybe b6989586621679419776) -> Type) (l :: TyFun [a6989586621679419775] [b6989586621679419776])
- type MapMaybeSym2 (t :: TyFun a6989586621679419775 (Maybe b6989586621679419776) -> Type) (t :: [a6989586621679419775]) = MapMaybe t t
Documentation
The singleton kind-indexed data family.
Instances
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) #
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) #
type family FromMaybe (a :: a) (a :: Maybe a) :: a where ... #
Equations
| FromMaybe d x = Case_6989586621679420012 d x x |
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 ... #
Equations
| ListToMaybe '[] = NothingSym0 | |
| ListToMaybe ((:) a _) = Apply JustSym0 a |
sListToMaybe :: forall (t :: [a]). Sing t -> Sing (Apply ListToMaybeSym0 t :: Maybe a) #
type family MaybeToList (a :: Maybe a) :: [a] where ... #
Equations
| MaybeToList Nothing = '[] | |
| MaybeToList (Just x) = Apply (Apply (:@#@$) x) '[] |
sMaybeToList :: forall (t :: Maybe a). Sing t -> Sing (Apply MaybeToListSym0 t :: [a]) #
sCatMaybes :: forall (t :: [Maybe a]). Sing t -> Sing (Apply CatMaybesSym0 t :: [a]) #
sMapMaybe :: forall (t :: TyFun a (Maybe b) -> Type) (t :: [a]). Sing t -> Sing t -> Sing (Apply (Apply MapMaybeSym0 t) t :: [b]) #
Defunctionalization symbols
type NothingSym0 = Nothing #
data JustSym0 (l :: TyFun a3530822107858468865 (Maybe a3530822107858468865)) #
Instances
| SuppressUnusedWarnings (JustSym0 :: TyFun a3530822107858468865 (Maybe a3530822107858468865) -> *) # | |
Defined in Data.Singletons.Prelude.Instances Methods suppressUnusedWarnings :: () # | |
| type Apply (JustSym0 :: TyFun a (Maybe a) -> *) (l :: a) # | |
data Maybe_Sym0 (l :: TyFun b6989586621679418662 (TyFun (TyFun a6989586621679418663 b6989586621679418662 -> Type) (TyFun (Maybe a6989586621679418663) b6989586621679418662 -> Type) -> Type)) #
Instances
| SuppressUnusedWarnings (Maybe_Sym0 :: TyFun b6989586621679418662 (TyFun (TyFun a6989586621679418663 b6989586621679418662 -> Type) (TyFun (Maybe a6989586621679418663) b6989586621679418662 -> Type) -> Type) -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (Maybe_Sym0 :: TyFun b6989586621679418662 (TyFun (TyFun a6989586621679418663 b6989586621679418662 -> Type) (TyFun (Maybe a6989586621679418663) b6989586621679418662 -> Type) -> Type) -> *) (l :: b6989586621679418662) # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (Maybe_Sym0 :: TyFun b6989586621679418662 (TyFun (TyFun a6989586621679418663 b6989586621679418662 -> Type) (TyFun (Maybe a6989586621679418663) b6989586621679418662 -> Type) -> Type) -> *) (l :: b6989586621679418662) = (Maybe_Sym1 l :: TyFun (TyFun a6989586621679418663 b6989586621679418662 -> Type) (TyFun (Maybe a6989586621679418663) b6989586621679418662 -> Type) -> *) | |
data Maybe_Sym1 (l :: b6989586621679418662) (l :: TyFun (TyFun a6989586621679418663 b6989586621679418662 -> Type) (TyFun (Maybe a6989586621679418663) b6989586621679418662 -> Type)) #
Instances
| SuppressUnusedWarnings (Maybe_Sym1 :: b6989586621679418662 -> TyFun (TyFun a6989586621679418663 b6989586621679418662 -> Type) (TyFun (Maybe a6989586621679418663) b6989586621679418662 -> Type) -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (Maybe_Sym1 l1 :: TyFun (TyFun a6989586621679418663 b6989586621679418662 -> Type) (TyFun (Maybe a6989586621679418663) b6989586621679418662 -> Type) -> *) (l2 :: TyFun a6989586621679418663 b6989586621679418662 -> Type) # | |
Defined in Data.Singletons.Prelude.Maybe | |
data Maybe_Sym2 (l :: b6989586621679418662) (l :: TyFun a6989586621679418663 b6989586621679418662 -> Type) (l :: TyFun (Maybe a6989586621679418663) b6989586621679418662) #
Instances
| SuppressUnusedWarnings (Maybe_Sym2 :: b6989586621679418662 -> (TyFun a6989586621679418663 b6989586621679418662 -> Type) -> TyFun (Maybe a6989586621679418663) b6989586621679418662 -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (Maybe_Sym2 l1 l2 :: TyFun (Maybe a) b -> *) (l3 :: Maybe a) # | |
Defined in Data.Singletons.Prelude.Maybe | |
type Maybe_Sym3 (t :: b6989586621679418662) (t :: TyFun a6989586621679418663 b6989586621679418662 -> Type) (t :: Maybe a6989586621679418663) = Maybe_ t t t #
data IsJustSym0 (l :: TyFun (Maybe a6989586621679419783) Bool) #
Instances
| SuppressUnusedWarnings (IsJustSym0 :: TyFun (Maybe a6989586621679419783) Bool -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (IsJustSym0 :: TyFun (Maybe a) Bool -> *) (l :: Maybe a) # | |
Defined in Data.Singletons.Prelude.Maybe | |
type IsJustSym1 (t :: Maybe a6989586621679419783) = IsJust t #
data IsNothingSym0 (l :: TyFun (Maybe a6989586621679419782) Bool) #
Instances
| SuppressUnusedWarnings (IsNothingSym0 :: TyFun (Maybe a6989586621679419782) Bool -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (IsNothingSym0 :: TyFun (Maybe a) Bool -> *) (l :: Maybe a) # | |
Defined in Data.Singletons.Prelude.Maybe | |
type IsNothingSym1 (t :: Maybe a6989586621679419782) = IsNothing t #
data FromJustSym0 (l :: TyFun (Maybe a6989586621679419781) a6989586621679419781) #
Instances
| SuppressUnusedWarnings (FromJustSym0 :: TyFun (Maybe a6989586621679419781) a6989586621679419781 -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (FromJustSym0 :: TyFun (Maybe a) a -> *) (l :: Maybe a) # | |
Defined in Data.Singletons.Prelude.Maybe | |
type FromJustSym1 (t :: Maybe a6989586621679419781) = FromJust t #
data FromMaybeSym0 (l :: TyFun a6989586621679419780 (TyFun (Maybe a6989586621679419780) a6989586621679419780 -> Type)) #
Instances
| SuppressUnusedWarnings (FromMaybeSym0 :: TyFun a6989586621679419780 (TyFun (Maybe a6989586621679419780) a6989586621679419780 -> Type) -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (FromMaybeSym0 :: TyFun a6989586621679419780 (TyFun (Maybe a6989586621679419780) a6989586621679419780 -> Type) -> *) (l :: a6989586621679419780) # | |
Defined in Data.Singletons.Prelude.Maybe type Apply (FromMaybeSym0 :: TyFun a6989586621679419780 (TyFun (Maybe a6989586621679419780) a6989586621679419780 -> Type) -> *) (l :: a6989586621679419780) = FromMaybeSym1 l | |
data FromMaybeSym1 (l :: a6989586621679419780) (l :: TyFun (Maybe a6989586621679419780) a6989586621679419780) #
Instances
| SuppressUnusedWarnings (FromMaybeSym1 :: a6989586621679419780 -> TyFun (Maybe a6989586621679419780) a6989586621679419780 -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (FromMaybeSym1 l1 :: TyFun (Maybe a) a -> *) (l2 :: Maybe a) # | |
Defined in Data.Singletons.Prelude.Maybe | |
type FromMaybeSym2 (t :: a6989586621679419780) (t :: Maybe a6989586621679419780) = FromMaybe t t #
data ListToMaybeSym0 (l :: TyFun [a6989586621679419778] (Maybe a6989586621679419778)) #
Instances
| SuppressUnusedWarnings (ListToMaybeSym0 :: TyFun [a6989586621679419778] (Maybe a6989586621679419778) -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (ListToMaybeSym0 :: TyFun [a] (Maybe a) -> *) (l :: [a]) # | |
Defined in Data.Singletons.Prelude.Maybe | |
type ListToMaybeSym1 (t :: [a6989586621679419778]) = ListToMaybe t #
data MaybeToListSym0 (l :: TyFun (Maybe a6989586621679419779) [a6989586621679419779]) #
Instances
| SuppressUnusedWarnings (MaybeToListSym0 :: TyFun (Maybe a6989586621679419779) [a6989586621679419779] -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (MaybeToListSym0 :: TyFun (Maybe a) [a] -> *) (l :: Maybe a) # | |
Defined in Data.Singletons.Prelude.Maybe | |
type MaybeToListSym1 (t :: Maybe a6989586621679419779) = MaybeToList t #
data CatMaybesSym0 (l :: TyFun [Maybe a6989586621679419777] [a6989586621679419777]) #
Instances
| SuppressUnusedWarnings (CatMaybesSym0 :: TyFun [Maybe a6989586621679419777] [a6989586621679419777] -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (CatMaybesSym0 :: TyFun [Maybe a] [a] -> *) (l :: [Maybe a]) # | |
Defined in Data.Singletons.Prelude.Maybe | |
type CatMaybesSym1 (t :: [Maybe a6989586621679419777]) = CatMaybes t #
data MapMaybeSym0 (l :: TyFun (TyFun a6989586621679419775 (Maybe b6989586621679419776) -> Type) (TyFun [a6989586621679419775] [b6989586621679419776] -> Type)) #
Instances
| SuppressUnusedWarnings (MapMaybeSym0 :: TyFun (TyFun a6989586621679419775 (Maybe b6989586621679419776) -> Type) (TyFun [a6989586621679419775] [b6989586621679419776] -> Type) -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (MapMaybeSym0 :: TyFun (TyFun a6989586621679419775 (Maybe b6989586621679419776) -> Type) (TyFun [a6989586621679419775] [b6989586621679419776] -> Type) -> *) (l :: TyFun a6989586621679419775 (Maybe b6989586621679419776) -> Type) # | |
Defined in Data.Singletons.Prelude.Maybe | |
data MapMaybeSym1 (l :: TyFun a6989586621679419775 (Maybe b6989586621679419776) -> Type) (l :: TyFun [a6989586621679419775] [b6989586621679419776]) #
Instances
| SuppressUnusedWarnings (MapMaybeSym1 :: (TyFun a6989586621679419775 (Maybe b6989586621679419776) -> Type) -> TyFun [a6989586621679419775] [b6989586621679419776] -> *) # | |
Defined in Data.Singletons.Prelude.Maybe Methods suppressUnusedWarnings :: () # | |
| type Apply (MapMaybeSym1 l1 :: TyFun [a] [b] -> *) (l2 :: [a]) # | |
Defined in Data.Singletons.Prelude.Maybe | |