singletons-2.2: A framework for generating singleton types

Data.Promotion.Prelude.Maybe

Description

Defines promoted functions and datatypes relating to Maybe, including a promoted 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

# Promoted functions from Data.Maybe

maybe_ :: forall b a. b -> (a -> b) -> Maybe a -> b Source #

type family Maybe_ (a :: b) (a :: TyFun a b -> Type) (a :: Maybe a) :: b where ... Source #

Equations

 Maybe_ n _z_1627847793 Nothing = n Maybe_ _z_1627847796 f (Just x) = Apply f x

The preceding two definitions is derived from the function maybe in Data.Maybe. The extra underscore is to avoid name clashes with the type Maybe.

type family IsJust (a :: Maybe a) :: Bool where ... Source #

Equations

 IsJust Nothing = FalseSym0 IsJust (Just _z_1627849157) = TrueSym0

type family IsNothing (a :: Maybe a) :: Bool where ... Source #

Equations

 IsNothing Nothing = TrueSym0 IsNothing (Just _z_1627849150) = FalseSym0

type family FromJust (a :: Maybe a) :: a where ... Source #

Equations

 FromJust Nothing = Apply ErrorSym0 "Maybe.fromJust: Nothing" FromJust (Just x) = x

type family FromMaybe (a :: a) (a :: Maybe a) :: a where ... Source #

Equations

 FromMaybe d x = Case_1627849137 d x x

type family MaybeToList (a :: Maybe a) :: [a] where ... Source #

Equations

 MaybeToList Nothing = '[] MaybeToList (Just x) = Apply (Apply (:$) x) '[] type family ListToMaybe (a :: [a]) :: Maybe a where ... Source # Equations  ListToMaybe '[] = NothingSym0 ListToMaybe ((:) a _z_1627849118) = Apply JustSym0 a type family CatMaybes (a :: [Maybe a]) :: [a] where ... Source # Equations  CatMaybes '[] = '[] CatMaybes ((:) (Just x) xs) = Apply (Apply (:$) x) (Apply CatMaybesSym0 xs) CatMaybes ((:) Nothing xs) = Apply CatMaybesSym0 xs

type family MapMaybe (a :: TyFun a (Maybe b) -> Type) (a :: [a]) :: [b] where ... Source #

Equations

 MapMaybe _z_1627849070 '[] = '[] MapMaybe f ((:) x xs) = Case_1627849102 f x xs (Let1627849089Scrutinee_1627849059Sym3 f x xs)

# Defunctionalization symbols

data JustSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun a822083586 (Maybe a822083586) -> *) (JustSym0 a822083586) Source # MethodssuppressUnusedWarnings :: Proxy (JustSym0 a822083586) t -> () Source # type Apply a822083586 (Maybe a822083586) (JustSym0 a822083586) l0 Source # type Apply a822083586 (Maybe a822083586) (JustSym0 a822083586) l0 = JustSym1 a822083586 l0

type JustSym1 t = Just t 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 # MethodssuppressUnusedWarnings :: Proxy (Maybe_Sym0 a1627847772 b1627847771) t -> () Source # type Apply b1627847771 (TyFun (TyFun a1627847772 b1627847771 -> Type) (TyFun (Maybe a1627847772) b1627847771 -> Type) -> Type) (Maybe_Sym0 a1627847772 b1627847771) l0 Source # type Apply b1627847771 (TyFun (TyFun a1627847772 b1627847771 -> Type) (TyFun (Maybe a1627847772) b1627847771 -> Type) -> Type) (Maybe_Sym0 a1627847772 b1627847771) l0 = Maybe_Sym1 a1627847772 b1627847771 l0

data Maybe_Sym1 l l Source #

Instances

 SuppressUnusedWarnings (b1627847771 -> TyFun (TyFun a1627847772 b1627847771 -> Type) (TyFun (Maybe a1627847772) b1627847771 -> Type) -> *) (Maybe_Sym1 a1627847772 b1627847771) Source # MethodssuppressUnusedWarnings :: Proxy (Maybe_Sym1 a1627847772 b1627847771) t -> () Source # type Apply (TyFun a1627847772 b1627847771 -> Type) (TyFun (Maybe a1627847772) b1627847771 -> Type) (Maybe_Sym1 a1627847772 b1627847771 l1) l0 Source # type Apply (TyFun a1627847772 b1627847771 -> Type) (TyFun (Maybe a1627847772) b1627847771 -> Type) (Maybe_Sym1 a1627847772 b1627847771 l1) l0 = Maybe_Sym2 a1627847772 b1627847771 l1 l0

data Maybe_Sym2 l l l Source #

Instances

 SuppressUnusedWarnings (b1627847771 -> (TyFun a1627847772 b1627847771 -> Type) -> TyFun (Maybe a1627847772) b1627847771 -> *) (Maybe_Sym2 a1627847772 b1627847771) Source # MethodssuppressUnusedWarnings :: Proxy (Maybe_Sym2 a1627847772 b1627847771) t -> () Source # type Apply (Maybe a1627847772) b1627847771 (Maybe_Sym2 a1627847772 b1627847771 l1 l2) l0 Source # type Apply (Maybe a1627847772) b1627847771 (Maybe_Sym2 a1627847772 b1627847771 l1 l2) l0 = Maybe_Sym3 b1627847771 a1627847772 l1 l2 l0

type Maybe_Sym3 t t t = Maybe_ t t t Source #

data IsJustSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun (Maybe a1627849036) Bool -> *) (IsJustSym0 a1627849036) Source # MethodssuppressUnusedWarnings :: Proxy (IsJustSym0 a1627849036) t -> () Source # type Apply (Maybe a1627849036) Bool (IsJustSym0 a1627849036) l0 Source # type Apply (Maybe a1627849036) Bool (IsJustSym0 a1627849036) l0 = IsJustSym1 a1627849036 l0

data IsNothingSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun (Maybe a1627849035) Bool -> *) (IsNothingSym0 a1627849035) Source # MethodssuppressUnusedWarnings :: Proxy (IsNothingSym0 a1627849035) t -> () Source # type Apply (Maybe a1627849035) Bool (IsNothingSym0 a1627849035) l0 Source # type Apply (Maybe a1627849035) Bool (IsNothingSym0 a1627849035) l0 = IsNothingSym1 a1627849035 l0

data FromJustSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun (Maybe a1627849034) a1627849034 -> *) (FromJustSym0 a1627849034) Source # MethodssuppressUnusedWarnings :: Proxy (FromJustSym0 a1627849034) t -> () Source # type Apply (Maybe a1627849034) a1627849034 (FromJustSym0 a1627849034) l0 Source # type Apply (Maybe a1627849034) a1627849034 (FromJustSym0 a1627849034) l0 = FromJustSym1 a1627849034 l0

data FromMaybeSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun a1627849033 (TyFun (Maybe a1627849033) a1627849033 -> Type) -> *) (FromMaybeSym0 a1627849033) Source # MethodssuppressUnusedWarnings :: Proxy (FromMaybeSym0 a1627849033) t -> () Source # type Apply a1627849033 (TyFun (Maybe a1627849033) a1627849033 -> Type) (FromMaybeSym0 a1627849033) l0 Source # type Apply a1627849033 (TyFun (Maybe a1627849033) a1627849033 -> Type) (FromMaybeSym0 a1627849033) l0 = FromMaybeSym1 a1627849033 l0

data FromMaybeSym1 l l Source #

Instances

 SuppressUnusedWarnings (a1627849033 -> TyFun (Maybe a1627849033) a1627849033 -> *) (FromMaybeSym1 a1627849033) Source # MethodssuppressUnusedWarnings :: Proxy (FromMaybeSym1 a1627849033) t -> () Source # type Apply (Maybe a1627849033) a1627849033 (FromMaybeSym1 a1627849033 l1) l0 Source # type Apply (Maybe a1627849033) a1627849033 (FromMaybeSym1 a1627849033 l1) l0 = FromMaybeSym2 a1627849033 l1 l0

Instances

 SuppressUnusedWarnings (TyFun (Maybe a1627849032) [a1627849032] -> *) (MaybeToListSym0 a1627849032) Source # MethodssuppressUnusedWarnings :: Proxy (MaybeToListSym0 a1627849032) t -> () Source # type Apply (Maybe a1627849032) [a1627849032] (MaybeToListSym0 a1627849032) l0 Source # type Apply (Maybe a1627849032) [a1627849032] (MaybeToListSym0 a1627849032) l0 = MaybeToListSym1 a1627849032 l0

Instances

 SuppressUnusedWarnings (TyFun [a1627849031] (Maybe a1627849031) -> *) (ListToMaybeSym0 a1627849031) Source # MethodssuppressUnusedWarnings :: Proxy (ListToMaybeSym0 a1627849031) t -> () Source # type Apply [a1627849031] (Maybe a1627849031) (ListToMaybeSym0 a1627849031) l0 Source # type Apply [a1627849031] (Maybe a1627849031) (ListToMaybeSym0 a1627849031) l0 = ListToMaybeSym1 a1627849031 l0

data CatMaybesSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun [Maybe a1627849030] [a1627849030] -> *) (CatMaybesSym0 a1627849030) Source # MethodssuppressUnusedWarnings :: Proxy (CatMaybesSym0 a1627849030) t -> () Source # type Apply [Maybe a1627849030] [a1627849030] (CatMaybesSym0 a1627849030) l0 Source # type Apply [Maybe a1627849030] [a1627849030] (CatMaybesSym0 a1627849030) l0 = CatMaybesSym1 a1627849030 l0

data MapMaybeSym0 l Source #

Instances

 SuppressUnusedWarnings (TyFun (TyFun a1627849028 (Maybe b1627849029) -> Type) (TyFun [a1627849028] [b1627849029] -> Type) -> *) (MapMaybeSym0 a1627849028 b1627849029) Source # MethodssuppressUnusedWarnings :: Proxy (MapMaybeSym0 a1627849028 b1627849029) t -> () Source # type Apply (TyFun a1627849028 (Maybe b1627849029) -> Type) (TyFun [a1627849028] [b1627849029] -> Type) (MapMaybeSym0 a1627849028 b1627849029) l0 Source # type Apply (TyFun a1627849028 (Maybe b1627849029) -> Type) (TyFun [a1627849028] [b1627849029] -> Type) (MapMaybeSym0 a1627849028 b1627849029) l0 = MapMaybeSym1 a1627849028 b1627849029 l0

data MapMaybeSym1 l l Source #

Instances

 SuppressUnusedWarnings ((TyFun a1627849028 (Maybe b1627849029) -> Type) -> TyFun [a1627849028] [b1627849029] -> *) (MapMaybeSym1 a1627849028 b1627849029) Source # MethodssuppressUnusedWarnings :: Proxy (MapMaybeSym1 a1627849028 b1627849029) t -> () Source # type Apply [a1627849028] [b1627849029] (MapMaybeSym1 a1627849028 b1627849029 l1) l0 Source # type Apply [a1627849028] [b1627849029] (MapMaybeSym1 a1627849028 b1627849029 l1) l0 = MapMaybeSym2 a1627849028 b1627849029 l1 l0

type MapMaybeSym2 t t = MapMaybe t t Source #