BooleanFunctions

class Object
trait Matchable
class Any
object Scalaz
object boolean

Value members

Concrete methods

final
def conditional(p: Boolean, q: => Boolean): Boolean

Conditional.

Conditional.

p q  p --> q
0 0  1
0 1  1
1 0  0
1 1  1
final
def conjunction(p: Boolean, q: => Boolean): Boolean

Conjunction. (AND)

Conjunction. (AND)

p q  p ∧ q
0 0  0
0 1  0
1 0  0
1 1  1
final
def disjunction(p: Boolean, q: => Boolean): Boolean

Disjunction. (OR)

Disjunction. (OR)

p q  p ∨ q
0 0  0
0 1  1
1 0  1
1 1  1
final
def emptyOrPoint[M[_], A](cond: Boolean)(a: => A)(implicit M: Applicative[M], M0: PlusEmpty[M]): M[A]

Returns the value a lifted into the context M if cond is false, otherwise, the empty value for M.

Returns the value a lifted into the context M if cond is false, otherwise, the empty value for M.

final
def emptyOrPointNT[M[_]](cond: Boolean)(implicit M: Applicative[M], M0: PlusEmpty[M]): NaturalTransformation[Id, M]

emptyOrPoint curried into a natural transformation.

emptyOrPoint curried into a natural transformation.

final
def fold[A](cond: Boolean, t: => A, f: => A): A
Returns

t if cond is true, f otherwise

final
def inverseConditional(p: Boolean, q: => Boolean): Boolean

Inverse Conditional.

Inverse Conditional.

p q  p <-- q
0 0  1
0 1  0
1 0  1
1 1  1
final
def nand(p: Boolean, q: => Boolean): Boolean

Negation of Conjunction. (NAND)

Negation of Conjunction. (NAND)

p q  p !&& q
0 0  1
0 1  1
1 0  1
1 1  0
final
def negConditional(p: Boolean, q: => Boolean): Boolean

Negational of Conditional.

Negational of Conditional.

p q  p ⇏ q
0 0  0
0 1  0
1 0  1
1 1  0
final
def negInverseConditional(p: Boolean, q: => Boolean): Boolean

Negation of Inverse Conditional.

Negation of Inverse Conditional.

p q  p <\- q
0 0  0
0 1  1
1 0  0
1 1  0
final
def nor(p: Boolean, q: => Boolean): Boolean

Negation of Disjunction. (NOR)

Negation of Disjunction. (NOR)

p q  p !|| q
0 0  1
0 1  0
1 0  0
1 1  0
final
def option[A](cond: Boolean, a: => A): Option[A]

Returns the given argument in Some if cond is true, None otherwise.

Returns the given argument in Some if cond is true, None otherwise.

final
def pointOrEmpty[M[_], A](cond: Boolean)(a: => A)(implicit M: Applicative[M], M0: PlusEmpty[M]): M[A]

Returns the value a lifted into the context M if cond is true, otherwise, the empty value for M.

Returns the value a lifted into the context M if cond is true, otherwise, the empty value for M.

final
def pointOrEmptyNT[M[_]](cond: Boolean)(implicit M: Applicative[M], M0: PlusEmpty[M]): NaturalTransformation[Id, M]

pointOrEmpty curried into a natural transformation.

pointOrEmpty curried into a natural transformation.

def test(p: Boolean): Int

Returns 1 if p is true, or 0 otherwise.

Returns 1 if p is true, or 0 otherwise.

final
def unless(cond: Boolean)(f: => Unit): Unit

Executes the given side-effect if cond is false

Executes the given side-effect if cond is false

final
def unlessM[M[_], A](cond: Boolean)(f: => M[A])(implicit M: Applicative[M]): M[Unit]

Returns the given argument if cond is false, otherwise, unit lifted into M.

Returns the given argument if cond is false, otherwise, unit lifted into M.

final
def unlessMU[MA](cond: Boolean)(f: => MA)(implicit M: Unapply[[F[_]] =>> Applicative[F], MA]): M[Unit]

A version of unlessM that infers the type constructor M.

A version of unlessM that infers the type constructor M.

final
def valueOrZero[A](cond: Boolean)(value: => A)(implicit z: Monoid[A]): A

Returns the given argument if cond is true, otherwise, the zero element for the type of the given argument.

Returns the given argument if cond is true, otherwise, the zero element for the type of the given argument.

final
def when(cond: Boolean)(f: => Unit): Unit

Executes the given side-effect if cond is true

Executes the given side-effect if cond is true

final
def whenM[M[_], A](cond: Boolean)(f: => M[A])(implicit M: Applicative[M]): M[Unit]

Returns the given argument if cond is true, otherwise, unit lifted into M.

Returns the given argument if cond is true, otherwise, unit lifted into M.

final
def whenMU[MA](cond: Boolean)(f: => MA)(implicit M: Unapply[[F[_]] =>> Applicative[F], MA]): M[Unit]

A version of whenM that infers the type constructor M.

A version of whenM that infers the type constructor M.

final
def zeroOrValue[A](cond: Boolean)(value: => A)(implicit z: Monoid[A]): A

Returns the given argument if cond is false, otherwise, the zero element for the type of the given argument.

Returns the given argument if cond is false, otherwise, the zero element for the type of the given argument.