object Bool
Contains implementation for Bool and typeconstructor aliases that make usage more pleasant
The operations can be shown to satisfy:
1. Associativity of Or: ||[A, B || C] =:= ||[A || B, C]
2. Associativity of And: &&[A, B && C] =:= &&[A && B, C]
3. Commutativity of Or: ||[A, B] =:= ||[B, A]
4. Commutativity of And: &&[A, B] =:= &&[B, A]
5. Distributivity of Or over And: ||[A, B && C] =:= &&[A || B, A || C]
6. Distributivity of And over Or: &&[A, B || C] =:= ||[A && B, A && C]
7. Identity for Or: ||[A, False] =:= A
8. Identity for And: &&[A, True] =:= A
9. Annhilator for Or: ||[A, True] =:= True
10. Annhilator for And: &&[A, False] =:= False
11. Idempotence of Or: ||[A, A] =:= A
12. Idempotence of And: &&[A, A] =:= A
13. Absorption 1: &&[A, A || B] =:= A
14. Absorbtion 2: ||[A, A && B] =:= A
15. Complementation 1: &&[A, Not[A]] =:= False
16. Complementation 2: ||[A, Not[A]] =:= True
17. Double Negation: Not[Not[A]] =:= A
18. De Morgan 1: &&[Not[A], Not[B]] =:= Not[A || B]
19. De Morgan 2: ||[Not[A], Not[B]] =:= Not[A && B]
Author:
Harshad Deo
- Since
0.1
- Grouped
- Alphabetic
- By Inheritance
- Bool
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type &&[A <: Bool, B <: Bool] = Bool.&&.A.If[B, False, Bool]
Type constructor for logical conjunction
Type constructor for logical conjunction
A && B =:= True if A =:= True and B =:= True
A && B =:= False otherwise
Author:
Harshad Deo
- Since
0.1
- type ->>[A <: Bool, B <: Bool] = Bool.->>.A.If[B, True, Bool]
Typeconstructor for material implication
Typeconstructor for material implication
If A =:= True, A ->> B =:= B
If A =:= False,
the value of B is ignored and the constructor returns TrueAuthor:
Harshad Deo
- Since
0.1
- final class BoolRep[B <: Bool] extends AnyVal
Provides a value for a type level boolean
Provides a value for a type level boolean
Author:
Harshad Deo
- Since
0.1
- type Eqv[A <: Bool, B <: Bool] = Bool.Eqv.A.If[B, Not[B], Bool]
Type constructor for logical equivalence
Type constructor for logical equivalence
A Eqv B =:= True if A =:= B
A Eqv B =:= False otherwise
Author:
Harshad Deo
- Since
0.1
- final class False extends Bool
Typelevel representation of a predicate being False
Typelevel representation of a predicate being False
Author:
Harshad Deo
- Since
0.1
- type Not[A <: Bool] = Bool.Not.A.If[False, True, Bool]
Type constructor for logical negation
Type constructor for logical negation
Not[True] =:= False
Not[False] =:= True
Author:
Harshad Deo
- Since
0.1
- final class True extends Bool
Typelevel representation of a predicate being true
Typelevel representation of a predicate being true
Author:
Harshad Deo
- Since
0.1
- type Xor[A <: Bool, B <: Bool] = Bool.Xor.A.If[Not[B], B, Bool]
Type constructor for logical exclusive or
Type constructor for logical exclusive or
A Xor B =:= True
if exactly one ofA =:= True or B =:= True
A Xor B =:= False
otherwiseAuthor:
Harshad Deo
- Since
0.1
- type ||[A <: Bool, B <: Bool] = Bool.||.A.If[True, B, Bool]
Type constructor for logical disjunction
Type constructor for logical disjunction
A || B =:= False if A =:= False and B =:= False
A || B =:= True otherwise
Author:
Harshad Deo
- Since
0.1
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toBoolean[B <: Bool](implicit ev: BoolRep[B]): Boolean
Method to convert a typelevel boolean to its value representation
Method to convert a typelevel boolean to its value representation
Author:
Harshad Deo
- B
Type of the boolean to be converted to a value
- Since
0.1
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- object BoolRep
Provides implicits for converting typelevel booleans to value level booleans
Provides implicits for converting typelevel booleans to value level booleans
Author:
Harshad Deo
- Since
0.1