singletons-base-3.4: A promoted and singled version of the base library
Copyright(C) 2013-2014 Richard Eisenberg Jan Stolarek
LicenseBSD-style (see LICENSE)
MaintainerRyan Scott
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageGHC2021

Data.Bool.Singletons

Description

Defines functions and datatypes relating to the singleton for Bool, including singled versions of all the definitions in Data.Bool.

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.Bool. Also, please excuse the apparent repeated variable names. This is due to an interaction between Template Haskell and Haddock.

Synopsis

The Bool singleton

type family Sing :: k -> Type #

Instances

Instances details
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SVoid
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SAll
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SAny
type Sing Source # 
Instance details

Defined in GHC.TypeLits.Singletons.Internal

type Sing = SNat
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing Source # 
Instance details

Defined in Data.Singletons.Base.TypeError

type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple0
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SBool
type Sing Source # 
Instance details

Defined in GHC.TypeLits.Singletons.Internal

type Sing = SChar
type Sing Source # 
Instance details

Defined in GHC.TypeLits.Singletons.Internal

type Sing = SSymbol
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SFirst :: First a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SLast :: Last a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SMax :: Max a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SMin :: Min a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SNonEmpty :: NonEmpty a -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SIdentity :: Identity a -> Type
type Sing Source # 
Instance details

Defined in Data.Monoid.Singletons

type Sing = SFirst :: First a -> Type
type Sing Source # 
Instance details

Defined in Data.Monoid.Singletons

type Sing = SLast :: Last a -> Type
type Sing Source # 
Instance details

Defined in Data.Ord.Singletons

type Sing = SDown :: Down a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SDual :: Dual a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SProduct :: Product a -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons.Internal.Wrappers

type Sing = SSum :: Sum a -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SMaybe :: Maybe a -> Type
type Sing Source #

A choice of singleton for the kind TYPE rep (for some RuntimeRep rep), an instantiation of which is the famous kind Type.

Conceivably, one could generalize this instance to `Sing @k` for any kind k, and remove all other Sing instances. We don't adopt this design, however, since it is far more convenient in practice to work with explicit singleton values than TypeReps (for instance, TypeReps are more difficult to pattern match on, and require extra runtime checks).

We cannot produce explicit singleton values for everything in TYPE rep, however, since it is an open kind, so we reach for TypeRep in this one particular case.

Instance details

Defined in Data.Singletons.Base.TypeRepTYPE

type Sing = TypeRep :: TYPE rep -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SList :: [a] -> Type
type Sing Source # 
Instance details

Defined in Data.Semigroup.Singletons

type Sing = SArg :: Arg a b -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = SEither :: Either a b -> Type
type Sing Source # 
Instance details

Defined in Data.Proxy.Singletons

type Sing = SProxy :: Proxy t -> Type
type Sing 
Instance details

Defined in Data.Singletons

type Sing 
Instance details

Defined in Data.Singletons

type Sing = SLambda :: (k1 ~> k2) -> Type
type Sing 
Instance details

Defined in Data.Singletons.Sigma

type Sing = SSigma :: Sigma s t -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple2 :: (a, b) -> Type
type Sing Source # 
Instance details

Defined in Data.Functor.Const.Singletons

type Sing = SConst :: Const a b -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple3 :: (a, b, c) -> Type
type Sing Source # 
Instance details

Defined in Data.Functor.Product.Singletons

type Sing = SProduct :: Product f g a -> Type
type Sing Source # 
Instance details

Defined in Data.Functor.Sum.Singletons

type Sing = SSum :: Sum f g a -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple4 :: (a, b, c, d) -> Type
type Sing Source # 
Instance details

Defined in Data.Functor.Compose.Singletons

type Sing = SCompose :: Compose f g a -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple5 :: (a, b, c, d, e) -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple6 :: (a, b, c, d, e, f) -> Type
type Sing Source # 
Instance details

Defined in Data.Singletons.Base.Instances

type Sing = STuple7 :: (a, b, c, d, e, f, g) -> Type

data SBool (a :: Bool) where Source #

Constructors

SFalse :: SBool 'False 
STrue :: SBool 'True 

Instances

Instances details
TestCoercion SBool Source # 
Instance details

Defined in Data.Singletons.Base.Instances

Methods

testCoercion :: forall (a :: Bool) (b :: Bool). SBool a -> SBool b -> Maybe (Coercion a b) #

TestEquality SBool Source # 
Instance details

Defined in Data.Singletons.Base.Instances

Methods

testEquality :: forall (a :: Bool) (b :: Bool). SBool a -> SBool b -> Maybe (a :~: b) #

Show (SBool z) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

Methods

showsPrec :: Int -> SBool z -> ShowS #

show :: SBool z -> String #

showList :: [SBool z] -> ShowS #

Eq (SBool z) Source # 
Instance details

Defined in Data.Singletons.Base.Instances

Methods

(==) :: SBool z -> SBool z -> Bool #

(/=) :: SBool z -> SBool z -> Bool #

Conditionals

type family If (cond :: Bool) (tru :: k) (fls :: k) :: k where ... #

Type-level If. If True a b ==> a; If False a b ==> b

Equations

If 'True (tru :: k) (fls :: k) = tru 
If 'False (tru :: k) (fls :: k) = fls 

sIf :: forall {k} (a :: Bool) (b :: k) (c :: k). Sing a -> Sing b -> Sing c -> Sing (If a b c) Source #

Conditional over singletons

Singletons from Data.Bool

type family Not (a :: Bool) = (res :: Bool) | res -> a where ... #

Type-level "not". An injective type family since 4.10.0.0.

@since base-4.7.0.0

Equations

Not 'False = 'True 
Not 'True = 'False 

sNot :: forall (a :: Bool). Sing a -> Sing (Not a) Source #

Negation of a singleton

type family (a :: Bool) && (b :: Bool) :: Bool where ... infixr 3 #

Type-level "and"

Equations

'False && a = 'False 
'True && a = a 
a && 'False = 'False 
a && 'True = a 
a && a = a 

type family (a :: Bool) || (b :: Bool) :: Bool where ... infixr 2 #

Type-level "or"

Equations

'False || a = a 
'True || a = 'True 
a || 'False = a 
a || 'True = 'True 
a || a = a 

(%&&) :: forall (a :: Bool) (b :: Bool). Sing a -> Sing b -> Sing (a && b) infixr 3 Source #

Conjunction of singletons

(%||) :: forall (a :: Bool) (b :: Bool). Sing a -> Sing b -> Sing (a || b) infixr 2 Source #

Disjunction of singletons

The following are derived from the function bool in Data.Bool. The extra underscore is to avoid name clashes with the type Bool.

bool_ :: a -> a -> Bool -> a Source #

type family Bool_ (a1 :: a) (a2 :: a) (a3 :: Bool) :: a where ... Source #

Equations

Bool_ (fls :: a) (_tru :: a) 'False = fls 
Bool_ (_fls :: a) (tru :: a) 'True = tru 

sBool_ :: forall a (t1 :: a) (t2 :: a) (t3 :: Bool). Sing t1 -> Sing t2 -> Sing t3 -> Sing (Apply (Apply (Apply (Bool_Sym0 :: TyFun a (a ~> (Bool ~> a)) -> Type) t1) t2) t3) Source #

type family Otherwise :: Bool where ... Source #

Equations

Otherwise = TrueSym0 

Defunctionalization symbols

type family TrueSym0 :: Bool where ... Source #

Equations

TrueSym0 = 'True 

type family FalseSym0 :: Bool where ... Source #

Equations

FalseSym0 = 'False 

data IfSym0 (a :: TyFun Bool (k ~> (k ~> k))) Source #

Instances

Instances details
SingI (IfSym0 :: TyFun Bool (k ~> (k ~> k)) -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing (IfSym0 :: TyFun Bool (k ~> (k ~> k)) -> Type) #

SuppressUnusedWarnings (IfSym0 :: TyFun Bool (k ~> (k ~> k)) -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (IfSym0 :: TyFun Bool (k ~> (k ~> k)) -> Type) (a6989586621679134776 :: Bool) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (IfSym0 :: TyFun Bool (k ~> (k ~> k)) -> Type) (a6989586621679134776 :: Bool) = IfSym1 a6989586621679134776 :: TyFun k (k ~> k) -> Type

data IfSym1 (a6989586621679134776 :: Bool) (b :: TyFun k (k ~> k)) Source #

Instances

Instances details
SingI1 (IfSym1 :: Bool -> TyFun k (k ~> k) -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

liftSing :: forall (x :: Bool). Sing x -> Sing (IfSym1 x :: TyFun k (k ~> k) -> Type) #

SingI c => SingI (IfSym1 c :: TyFun k (k ~> k) -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing (IfSym1 c :: TyFun k (k ~> k) -> Type) #

SuppressUnusedWarnings (IfSym1 a6989586621679134776 :: TyFun k (k ~> k) -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (IfSym1 a6989586621679134776 :: TyFun k (k ~> k) -> Type) (a6989586621679134777 :: k) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (IfSym1 a6989586621679134776 :: TyFun k (k ~> k) -> Type) (a6989586621679134777 :: k) = IfSym2 a6989586621679134776 a6989586621679134777

data IfSym2 (a6989586621679134776 :: Bool) (a6989586621679134777 :: k) (c :: TyFun k k) Source #

Instances

Instances details
SingI2 (IfSym2 :: Bool -> k2 -> TyFun k2 k2 -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

liftSing2 :: forall (x :: Bool) (y :: k2). Sing x -> Sing y -> Sing (IfSym2 x y) #

SingI c => SingI1 (IfSym2 c :: k1 -> TyFun k1 k1 -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

liftSing :: forall (x :: k1). Sing x -> Sing (IfSym2 c x) #

(SingI c, SingI t) => SingI (IfSym2 c t :: TyFun k k -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing (IfSym2 c t) #

SuppressUnusedWarnings (IfSym2 a6989586621679134776 a6989586621679134777 :: TyFun k k -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (IfSym2 a6989586621679134776 a6989586621679134777 :: TyFun k k -> Type) (a6989586621679134778 :: k) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (IfSym2 a6989586621679134776 a6989586621679134777 :: TyFun k k -> Type) (a6989586621679134778 :: k) = If a6989586621679134776 a6989586621679134777 a6989586621679134778

type family IfSym3 (a6989586621679134776 :: Bool) (a6989586621679134777 :: k) (a6989586621679134778 :: k) :: k where ... Source #

Equations

IfSym3 a6989586621679134776 (a6989586621679134777 :: k) (a6989586621679134778 :: k) = If a6989586621679134776 a6989586621679134777 a6989586621679134778 

data NotSym0 (a :: TyFun Bool Bool) Source #

Instances

Instances details
SingI NotSym0 Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing NotSym0 #

SuppressUnusedWarnings NotSym0 Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply NotSym0 (a6989586621679134554 :: Bool) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply NotSym0 (a6989586621679134554 :: Bool) = Not a6989586621679134554

type family NotSym1 (a6989586621679134554 :: Bool) :: Bool where ... Source #

Equations

NotSym1 a6989586621679134554 = Not a6989586621679134554 

data (&&@#@$) (a :: TyFun Bool (Bool ~> Bool)) infixr 3 Source #

Instances

Instances details
SingI (&&@#@$) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing (&&@#@$) #

SuppressUnusedWarnings (&&@#@$) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (&&@#@$) (a6989586621679133848 :: Bool) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (&&@#@$) (a6989586621679133848 :: Bool) = (&&@#@$$) a6989586621679133848

data (a6989586621679133848 :: Bool) &&@#@$$ (b :: TyFun Bool Bool) infixr 3 Source #

Instances

Instances details
SingI x => SingI ((&&@#@$$) x :: TyFun Bool Bool -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing ((&&@#@$$) x) #

SuppressUnusedWarnings ((&&@#@$$) a6989586621679133848 :: TyFun Bool Bool -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply ((&&@#@$$) a6989586621679133848 :: TyFun Bool Bool -> Type) (a6989586621679133849 :: Bool) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply ((&&@#@$$) a6989586621679133848 :: TyFun Bool Bool -> Type) (a6989586621679133849 :: Bool) = a6989586621679133848 && a6989586621679133849

type family (a6989586621679133848 :: Bool) &&@#@$$$ (a6989586621679133849 :: Bool) :: Bool where ... infixr 3 Source #

Equations

a6989586621679133848 &&@#@$$$ a6989586621679133849 = a6989586621679133848 && a6989586621679133849 

data (||@#@$) (a :: TyFun Bool (Bool ~> Bool)) infixr 2 Source #

Instances

Instances details
SingI (||@#@$) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing (||@#@$) #

SuppressUnusedWarnings (||@#@$) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (||@#@$) (a6989586621679134209 :: Bool) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (||@#@$) (a6989586621679134209 :: Bool) = (||@#@$$) a6989586621679134209

data (a6989586621679134209 :: Bool) ||@#@$$ (b :: TyFun Bool Bool) infixr 2 Source #

Instances

Instances details
SingI x => SingI ((||@#@$$) x :: TyFun Bool Bool -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing ((||@#@$$) x) #

SuppressUnusedWarnings ((||@#@$$) a6989586621679134209 :: TyFun Bool Bool -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply ((||@#@$$) a6989586621679134209 :: TyFun Bool Bool -> Type) (a6989586621679134210 :: Bool) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply ((||@#@$$) a6989586621679134209 :: TyFun Bool Bool -> Type) (a6989586621679134210 :: Bool) = a6989586621679134209 || a6989586621679134210

type family (a6989586621679134209 :: Bool) ||@#@$$$ (a6989586621679134210 :: Bool) :: Bool where ... infixr 2 Source #

Equations

a6989586621679134209 ||@#@$$$ a6989586621679134210 = a6989586621679134209 || a6989586621679134210 

data Bool_Sym0 (a1 :: TyFun a (a ~> (Bool ~> a))) Source #

Instances

Instances details
SingI (Bool_Sym0 :: TyFun a (a ~> (Bool ~> a)) -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing (Bool_Sym0 :: TyFun a (a ~> (Bool ~> a)) -> Type) #

SuppressUnusedWarnings (Bool_Sym0 :: TyFun a (a ~> (Bool ~> a)) -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (Bool_Sym0 :: TyFun a (a ~> (Bool ~> a)) -> Type) (a6989586621679132605 :: a) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (Bool_Sym0 :: TyFun a (a ~> (Bool ~> a)) -> Type) (a6989586621679132605 :: a) = Bool_Sym1 a6989586621679132605

data Bool_Sym1 (a6989586621679132605 :: a) (b :: TyFun a (Bool ~> a)) Source #

Instances

Instances details
SingI1 (Bool_Sym1 :: a -> TyFun a (Bool ~> a) -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

liftSing :: forall (x :: a). Sing x -> Sing (Bool_Sym1 x) #

SingI d => SingI (Bool_Sym1 d :: TyFun a (Bool ~> a) -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing (Bool_Sym1 d) #

SuppressUnusedWarnings (Bool_Sym1 a6989586621679132605 :: TyFun a (Bool ~> a) -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (Bool_Sym1 a6989586621679132605 :: TyFun a (Bool ~> a) -> Type) (a6989586621679132606 :: a) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (Bool_Sym1 a6989586621679132605 :: TyFun a (Bool ~> a) -> Type) (a6989586621679132606 :: a) = Bool_Sym2 a6989586621679132605 a6989586621679132606

data Bool_Sym2 (a6989586621679132605 :: a) (a6989586621679132606 :: a) (c :: TyFun Bool a) Source #

Instances

Instances details
SingI2 (Bool_Sym2 :: a -> a -> TyFun Bool a -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

liftSing2 :: forall (x :: a) (y :: a). Sing x -> Sing y -> Sing (Bool_Sym2 x y) #

SingI d => SingI1 (Bool_Sym2 d :: a -> TyFun Bool a -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

liftSing :: forall (x :: a). Sing x -> Sing (Bool_Sym2 d x) #

(SingI d1, SingI d2) => SingI (Bool_Sym2 d1 d2 :: TyFun Bool a -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

Methods

sing :: Sing (Bool_Sym2 d1 d2) #

SuppressUnusedWarnings (Bool_Sym2 a6989586621679132605 a6989586621679132606 :: TyFun Bool a -> Type) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (Bool_Sym2 a6989586621679132605 a6989586621679132606 :: TyFun Bool a -> Type) (a6989586621679132607 :: Bool) Source # 
Instance details

Defined in Data.Bool.Singletons

type Apply (Bool_Sym2 a6989586621679132605 a6989586621679132606 :: TyFun Bool a -> Type) (a6989586621679132607 :: Bool) = Bool_ a6989586621679132605 a6989586621679132606 a6989586621679132607

type family Bool_Sym3 (a6989586621679132605 :: a) (a6989586621679132606 :: a) (a6989586621679132607 :: Bool) :: a where ... Source #

Equations

Bool_Sym3 (a6989586621679132605 :: a) (a6989586621679132606 :: a) a6989586621679132607 = Bool_ a6989586621679132605 a6989586621679132606 a6989586621679132607 

type family OtherwiseSym0 :: Bool where ... Source #