singletons-2.2: A framework for generating singleton types

Copyright(C) 2014 Jan Stolarek
LicenseBSD-style (see LICENSE)
MaintainerJan Stolarek (jan.stolarek@p.lodz.pl)
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Promotion.Prelude.Maybe

Contents

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 #

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

Equations

Maybe_ n _z_6989586621679676169 Nothing = n 
Maybe_ _z_6989586621679676172 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 ... #

Equations

IsJust Nothing = FalseSym0 
IsJust (Just _z_6989586621679677522) = TrueSym0 

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

Equations

IsNothing Nothing = TrueSym0 
IsNothing (Just _z_6989586621679677515) = FalseSym0 

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

Equations

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

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

Equations

FromMaybe d x = Case_6989586621679677502 d x x 

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

Equations

MaybeToList Nothing = '[] 
MaybeToList (Just x) = Apply (Apply (:$) x) '[] 

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

Equations

ListToMaybe '[] = NothingSym0 
ListToMaybe ((:) a _z_6989586621679677483) = Apply JustSym0 a 

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

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 ... #

Equations

MapMaybe _z_6989586621679677435 '[] = '[] 
MapMaybe f ((:) x xs) = Case_6989586621679677467 f x xs (Let6989586621679677454Scrutinee_6989586621679677424Sym3 f x xs) 

Defunctionalization symbols

data JustSym0 l #

Instances

SuppressUnusedWarnings (TyFun a3530822107858468866 (Maybe a3530822107858468866) -> *) (JustSym0 a3530822107858468866) # 

Methods

suppressUnusedWarnings :: Proxy (JustSym0 a3530822107858468866) t -> () #

type Apply a3530822107858468866 (Maybe a3530822107858468866) (JustSym0 a3530822107858468866) l0 # 
type Apply a3530822107858468866 (Maybe a3530822107858468866) (JustSym0 a3530822107858468866) l0 = JustSym1 a3530822107858468866 l0

type JustSym1 t = Just t #

data Maybe_Sym0 l #

Instances

SuppressUnusedWarnings (TyFun b6989586621679676147 (TyFun (TyFun a6989586621679676148 b6989586621679676147 -> Type) (TyFun (Maybe a6989586621679676148) b6989586621679676147 -> Type) -> Type) -> *) (Maybe_Sym0 a6989586621679676148 b6989586621679676147) # 

Methods

suppressUnusedWarnings :: Proxy (Maybe_Sym0 a6989586621679676148 b6989586621679676147) t -> () #

type Apply b6989586621679676147 (TyFun (TyFun a6989586621679676148 b6989586621679676147 -> Type) (TyFun (Maybe a6989586621679676148) b6989586621679676147 -> Type) -> Type) (Maybe_Sym0 a6989586621679676148 b6989586621679676147) l0 # 
type Apply b6989586621679676147 (TyFun (TyFun a6989586621679676148 b6989586621679676147 -> Type) (TyFun (Maybe a6989586621679676148) b6989586621679676147 -> Type) -> Type) (Maybe_Sym0 a6989586621679676148 b6989586621679676147) l0 = Maybe_Sym1 a6989586621679676148 b6989586621679676147 l0

data Maybe_Sym1 l l #

Instances

SuppressUnusedWarnings (b6989586621679676147 -> TyFun (TyFun a6989586621679676148 b6989586621679676147 -> Type) (TyFun (Maybe a6989586621679676148) b6989586621679676147 -> Type) -> *) (Maybe_Sym1 a6989586621679676148 b6989586621679676147) # 

Methods

suppressUnusedWarnings :: Proxy (Maybe_Sym1 a6989586621679676148 b6989586621679676147) t -> () #

type Apply (TyFun a6989586621679676148 b6989586621679676147 -> Type) (TyFun (Maybe a6989586621679676148) b6989586621679676147 -> Type) (Maybe_Sym1 a6989586621679676148 b6989586621679676147 l0) l1 # 
type Apply (TyFun a6989586621679676148 b6989586621679676147 -> Type) (TyFun (Maybe a6989586621679676148) b6989586621679676147 -> Type) (Maybe_Sym1 a6989586621679676148 b6989586621679676147 l0) l1 = Maybe_Sym2 a6989586621679676148 b6989586621679676147 l0 l1

data Maybe_Sym2 l l l #

Instances

SuppressUnusedWarnings (b6989586621679676147 -> (TyFun a6989586621679676148 b6989586621679676147 -> Type) -> TyFun (Maybe a6989586621679676148) b6989586621679676147 -> *) (Maybe_Sym2 a6989586621679676148 b6989586621679676147) # 

Methods

suppressUnusedWarnings :: Proxy (Maybe_Sym2 a6989586621679676148 b6989586621679676147) t -> () #

type Apply (Maybe a6989586621679676148) b6989586621679676147 (Maybe_Sym2 a6989586621679676148 b6989586621679676147 l1 l0) l2 # 
type Apply (Maybe a6989586621679676148) b6989586621679676147 (Maybe_Sym2 a6989586621679676148 b6989586621679676147 l1 l0) l2 = Maybe_Sym3 a6989586621679676148 b6989586621679676147 l1 l0 l2

type Maybe_Sym3 t t t = Maybe_ t t t #

data IsJustSym0 l #

Instances

SuppressUnusedWarnings (TyFun (Maybe a6989586621679677401) Bool -> *) (IsJustSym0 a6989586621679677401) # 

Methods

suppressUnusedWarnings :: Proxy (IsJustSym0 a6989586621679677401) t -> () #

type Apply (Maybe a6989586621679677401) Bool (IsJustSym0 a6989586621679677401) l0 # 
type Apply (Maybe a6989586621679677401) Bool (IsJustSym0 a6989586621679677401) l0 = IsJustSym1 a6989586621679677401 l0

type IsJustSym1 t = IsJust t #

data IsNothingSym0 l #

Instances

SuppressUnusedWarnings (TyFun (Maybe a6989586621679677400) Bool -> *) (IsNothingSym0 a6989586621679677400) # 

Methods

suppressUnusedWarnings :: Proxy (IsNothingSym0 a6989586621679677400) t -> () #

type Apply (Maybe a6989586621679677400) Bool (IsNothingSym0 a6989586621679677400) l0 # 
type Apply (Maybe a6989586621679677400) Bool (IsNothingSym0 a6989586621679677400) l0 = IsNothingSym1 a6989586621679677400 l0

data FromJustSym0 l #

Instances

SuppressUnusedWarnings (TyFun (Maybe a6989586621679677399) a6989586621679677399 -> *) (FromJustSym0 a6989586621679677399) # 

Methods

suppressUnusedWarnings :: Proxy (FromJustSym0 a6989586621679677399) t -> () #

type Apply (Maybe a6989586621679677399) a6989586621679677399 (FromJustSym0 a6989586621679677399) l0 # 
type Apply (Maybe a6989586621679677399) a6989586621679677399 (FromJustSym0 a6989586621679677399) l0 = FromJustSym1 a6989586621679677399 l0

data FromMaybeSym0 l #

Instances

SuppressUnusedWarnings (TyFun a6989586621679677398 (TyFun (Maybe a6989586621679677398) a6989586621679677398 -> Type) -> *) (FromMaybeSym0 a6989586621679677398) # 

Methods

suppressUnusedWarnings :: Proxy (FromMaybeSym0 a6989586621679677398) t -> () #

type Apply a6989586621679677398 (TyFun (Maybe a6989586621679677398) a6989586621679677398 -> Type) (FromMaybeSym0 a6989586621679677398) l0 # 
type Apply a6989586621679677398 (TyFun (Maybe a6989586621679677398) a6989586621679677398 -> Type) (FromMaybeSym0 a6989586621679677398) l0 = FromMaybeSym1 a6989586621679677398 l0

data FromMaybeSym1 l l #

Instances

SuppressUnusedWarnings (a6989586621679677398 -> TyFun (Maybe a6989586621679677398) a6989586621679677398 -> *) (FromMaybeSym1 a6989586621679677398) # 

Methods

suppressUnusedWarnings :: Proxy (FromMaybeSym1 a6989586621679677398) t -> () #

type Apply (Maybe a6989586621679677398) a6989586621679677398 (FromMaybeSym1 a6989586621679677398 l0) l1 # 
type Apply (Maybe a6989586621679677398) a6989586621679677398 (FromMaybeSym1 a6989586621679677398 l0) l1 = FromMaybeSym2 a6989586621679677398 l0 l1

type FromMaybeSym2 t t = FromMaybe t t #

data MaybeToListSym0 l #

Instances

SuppressUnusedWarnings (TyFun (Maybe a6989586621679677397) [a6989586621679677397] -> *) (MaybeToListSym0 a6989586621679677397) # 

Methods

suppressUnusedWarnings :: Proxy (MaybeToListSym0 a6989586621679677397) t -> () #

type Apply (Maybe a6989586621679677397) [a6989586621679677397] (MaybeToListSym0 a6989586621679677397) l0 # 
type Apply (Maybe a6989586621679677397) [a6989586621679677397] (MaybeToListSym0 a6989586621679677397) l0 = MaybeToListSym1 a6989586621679677397 l0

data ListToMaybeSym0 l #

Instances

SuppressUnusedWarnings (TyFun [a6989586621679677396] (Maybe a6989586621679677396) -> *) (ListToMaybeSym0 a6989586621679677396) # 

Methods

suppressUnusedWarnings :: Proxy (ListToMaybeSym0 a6989586621679677396) t -> () #

type Apply [a6989586621679677396] (Maybe a6989586621679677396) (ListToMaybeSym0 a6989586621679677396) l0 # 
type Apply [a6989586621679677396] (Maybe a6989586621679677396) (ListToMaybeSym0 a6989586621679677396) l0 = ListToMaybeSym1 a6989586621679677396 l0

data CatMaybesSym0 l #

Instances

SuppressUnusedWarnings (TyFun [Maybe a6989586621679677395] [a6989586621679677395] -> *) (CatMaybesSym0 a6989586621679677395) # 

Methods

suppressUnusedWarnings :: Proxy (CatMaybesSym0 a6989586621679677395) t -> () #

type Apply [Maybe a6989586621679677395] [a6989586621679677395] (CatMaybesSym0 a6989586621679677395) l0 # 
type Apply [Maybe a6989586621679677395] [a6989586621679677395] (CatMaybesSym0 a6989586621679677395) l0 = CatMaybesSym1 a6989586621679677395 l0

data MapMaybeSym0 l #

Instances

SuppressUnusedWarnings (TyFun (TyFun a6989586621679677393 (Maybe b6989586621679677394) -> Type) (TyFun [a6989586621679677393] [b6989586621679677394] -> Type) -> *) (MapMaybeSym0 a6989586621679677393 b6989586621679677394) # 

Methods

suppressUnusedWarnings :: Proxy (MapMaybeSym0 a6989586621679677393 b6989586621679677394) t -> () #

type Apply (TyFun a6989586621679677393 (Maybe b6989586621679677394) -> Type) (TyFun [a6989586621679677393] [b6989586621679677394] -> Type) (MapMaybeSym0 a6989586621679677393 b6989586621679677394) l0 # 
type Apply (TyFun a6989586621679677393 (Maybe b6989586621679677394) -> Type) (TyFun [a6989586621679677393] [b6989586621679677394] -> Type) (MapMaybeSym0 a6989586621679677393 b6989586621679677394) l0 = MapMaybeSym1 a6989586621679677393 b6989586621679677394 l0

data MapMaybeSym1 l l #

Instances

SuppressUnusedWarnings ((TyFun a6989586621679677393 (Maybe b6989586621679677394) -> Type) -> TyFun [a6989586621679677393] [b6989586621679677394] -> *) (MapMaybeSym1 a6989586621679677393 b6989586621679677394) # 

Methods

suppressUnusedWarnings :: Proxy (MapMaybeSym1 a6989586621679677393 b6989586621679677394) t -> () #

type Apply [a6989586621679677393] [b6989586621679677394] (MapMaybeSym1 a6989586621679677393 b6989586621679677394 l0) l1 # 
type Apply [a6989586621679677393] [b6989586621679677394] (MapMaybeSym1 a6989586621679677393 b6989586621679677394 l0) l1 = MapMaybeSym2 a6989586621679677393 b6989586621679677394 l0 l1

type MapMaybeSym2 t t = MapMaybe t t #