singleton-bool-0.1.4: Type level booleans

Safe HaskellNone
LanguageHaskell2010

Data.Singletons.Bool

Contents

Description

Additions to Data.Type.Bool.

Synopsis

Documentation

data SBool (b :: Bool) where Source #

Constructors

STrue :: SBool True 
SFalse :: SBool False 

class SBoolI (b :: Bool) where Source #

Minimal complete definition

sbool

Methods

sbool :: SBool b Source #

fromSBool :: SBool b -> Bool Source #

Convert an SBool to the corresponding Bool.

@since next

withSomeSBool :: Bool -> (forall b. SBool b -> r) -> r Source #

Convert a normal Bool to an SBool, passing it into a continuation.

>>> withSomeSBool True fromSBool
True

@since next

reflectBool :: forall b proxy. SBoolI b => proxy b -> Bool Source #

reifyBool :: forall r. Bool -> (forall b. SBoolI b => Proxy b -> r) -> r Source #

Reify Bool.

>>> reifyBool True reflectBool
True

Data.Type.Bool and .Equality

These are only defined with base >= 4.7

sboolAnd :: SBool a -> SBool b -> SBool (a && b) Source #

sboolOr :: SBool a -> SBool b -> SBool (a || b) Source #

eqToRefl :: (a == b) ~ True => a :~: b Source #

Since: 0.1.1.0

eqCast :: (a == b) ~ True => a -> b Source #

Since: 0.1.1.0

sboolEqRefl :: forall (a :: k) (b :: k). SBoolI (a == b) => Maybe (a :~: b) Source #

Useful combination of sbool and eqToRefl

Since: 0.1.2.0

trivialRefl :: () :~: () Source #

Since: 0.1.1.0