singletons-2.3.1: A framework for generating singleton types

Copyright(C) 2013-2014 Richard Eisenberg Jan Stolarek
LicenseBSD-style (see LICENSE)
MaintainerRichard Eisenberg (rae@cs.brynmawr.edu)
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Singletons.Prelude.Bool

Contents

Description

Defines functions and datatypes relating to the singleton for Bool, including a singletons version 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

data family Sing (a :: k) Source #

The singleton kind-indexed data family.

Instances

data Sing Bool Source # 
data Sing Bool where
data Sing Ordering Source # 
data Sing * Source # 
data Sing * where
data Sing Nat Source # 
data Sing Nat where
data Sing Symbol Source # 
data Sing Symbol where
data Sing () Source # 
data Sing () where
data Sing [a] Source # 
data Sing [a] where
data Sing (Maybe a) Source # 
data Sing (Maybe a) where
data Sing (NonEmpty a) Source # 
data Sing (NonEmpty a) where
data Sing (Either a b) Source # 
data Sing (Either a b) where
data Sing (a, b) Source # 
data Sing (a, b) where
data Sing ((~>) k1 k2) Source # 
data Sing ((~>) k1 k2) = SLambda {}
data Sing (a, b, c) Source # 
data Sing (a, b, c) where
data Sing (a, b, c, d) Source # 
data Sing (a, b, c, d) where
data Sing (a, b, c, d, e) Source # 
data Sing (a, b, c, d, e) where
data Sing (a, b, c, d, e, f) Source # 
data Sing (a, b, c, d, e, f) where
data Sing (a, b, c, d, e, f, g) Source # 
data Sing (a, b, c, d, e, f, g) where

Though Haddock doesn't show it, the Sing instance above declares constructors

SFalse :: Sing False
STrue  :: Sing True

type SBool = (Sing :: Bool -> Type) Source #

SBool is a kind-restricted synonym for Sing: type SBool (a :: Bool) = Sing a

Conditionals

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

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

Equations

If k True tru fls = tru 
If k False tru fls = fls 

sIf :: Sing a -> Sing b -> Sing c -> Sing (If a b c) Source #

Conditional over singletons

Singletons from Data.Bool

type family Not (a :: Bool) :: Bool where ... Source #

sNot :: forall (t :: Bool). Sing t -> Sing (Apply NotSym0 t :: Bool) Source #

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

Equations

False :&& _z_6989586621679277808 = FalseSym0 
True :&& x = x 

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

Equations

False :|| x = x 
True :|| _z_6989586621679277796 = TrueSym0 

(%:&&) :: forall (t :: Bool) (t :: Bool). Sing t -> Sing t -> Sing (Apply (Apply (:&&$) t) t :: Bool) infixr 3 Source #

(%:||) :: forall (t :: Bool) (t :: Bool). Sing t -> Sing t -> Sing (Apply (Apply (:||$) t) t :: Bool) infixr 2 Source #

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_ (a :: a) (a :: a) (a :: Bool) :: a where ... Source #

Equations

Bool_ fls _tru False = fls 
Bool_ _fls tru True = tru 

sBool_ :: forall (t :: a) (t :: a) (t :: Bool). Sing t -> Sing t -> Sing t -> Sing (Apply (Apply (Apply Bool_Sym0 t) t) t :: a) Source #

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

Equations

Otherwise = TrueSym0 

Defunctionalization symbols

type NotSym1 (t :: Bool) = Not t Source #

data (l :: Bool) :&&$$ (l :: TyFun Bool Bool) Source #

type (:&&$$$) (t :: Bool) (t :: Bool) = (:&&) t t Source #

data (l :: Bool) :||$$ (l :: TyFun Bool Bool) Source #

type (:||$$$) (t :: Bool) (t :: Bool) = (:||) t t Source #

data Bool_Sym0 (l :: TyFun a6989586621679277161 (TyFun a6989586621679277161 (TyFun Bool a6989586621679277161 -> Type) -> Type)) Source #

Instances

SuppressUnusedWarnings (TyFun a6989586621679277161 (TyFun a6989586621679277161 (TyFun Bool a6989586621679277161 -> Type) -> Type) -> *) (Bool_Sym0 a6989586621679277161) Source # 

Methods

suppressUnusedWarnings :: Proxy (Bool_Sym0 a6989586621679277161) t -> () Source #

type Apply a6989586621679277161 (TyFun a6989586621679277161 (TyFun Bool a6989586621679277161 -> Type) -> Type) (Bool_Sym0 a6989586621679277161) l Source # 
type Apply a6989586621679277161 (TyFun a6989586621679277161 (TyFun Bool a6989586621679277161 -> Type) -> Type) (Bool_Sym0 a6989586621679277161) l = Bool_Sym1 a6989586621679277161 l

data Bool_Sym1 (l :: a6989586621679277161) (l :: TyFun a6989586621679277161 (TyFun Bool a6989586621679277161 -> Type)) Source #

Instances

SuppressUnusedWarnings (a6989586621679277161 -> TyFun a6989586621679277161 (TyFun Bool a6989586621679277161 -> Type) -> *) (Bool_Sym1 a6989586621679277161) Source # 

Methods

suppressUnusedWarnings :: Proxy (Bool_Sym1 a6989586621679277161) t -> () Source #

type Apply a6989586621679277161 (TyFun Bool a6989586621679277161 -> Type) (Bool_Sym1 a6989586621679277161 l1) l2 Source # 
type Apply a6989586621679277161 (TyFun Bool a6989586621679277161 -> Type) (Bool_Sym1 a6989586621679277161 l1) l2 = Bool_Sym2 a6989586621679277161 l1 l2

data Bool_Sym2 (l :: a6989586621679277161) (l :: a6989586621679277161) (l :: TyFun Bool a6989586621679277161) Source #

Instances

SuppressUnusedWarnings (a6989586621679277161 -> a6989586621679277161 -> TyFun Bool a6989586621679277161 -> *) (Bool_Sym2 a6989586621679277161) Source # 

Methods

suppressUnusedWarnings :: Proxy (Bool_Sym2 a6989586621679277161) t -> () Source #

type Apply Bool a (Bool_Sym2 a l1 l2) l3 Source # 
type Apply Bool a (Bool_Sym2 a l1 l2) l3 = Bool_ a l1 l2 l3

type Bool_Sym3 (t :: a6989586621679277161) (t :: a6989586621679277161) (t :: Bool) = Bool_ t t t Source #