BooleanSyntax

implicit
class BooleanSyntax(b: Boolean)

Syntax for treating booleans as indicators of success or failure in a computation.

The simplest usage is something like: myBoolean ~>? "Is my boolean true?". The 'value' and log tree of the returned treelog.LogTreeSyntax.DescribedComputation will indicate success or failure depending on the value of myBoolean.

class Object
trait Matchable
class Any

Value members

Concrete methods

def decribedWith(failureDescription: => String, successDescription: => String): DescribedComputation[Boolean]

Use different descriptions for the true and false cases. Note that unlike 'if' the false / failure description is the first parameter and the true / success description is the second parameter. This is to maintain consistency with OptionSyntax and EitherSyntax.

Use different descriptions for the true and false cases. Note that unlike 'if' the false / failure description is the first parameter and the true / success description is the second parameter. This is to maintain consistency with OptionSyntax and EitherSyntax.

If the boolean is true the 'value' of the returned DescribedComputation will be \/-(true), otherwise, the 'value' will be -\/(description).

def describedBy(description: String): DescribedComputation[Boolean]

Use the same description whether the boolean is true or false. Equivalent to ~>?(description, description)

Use the same description whether the boolean is true or false. Equivalent to ~>?(description, description)

def ~>?(description: String): DescribedComputation[Boolean]

Syntactic sugar equivalent to describedBy(description)

Syntactic sugar equivalent to describedBy(description)

def ~>?(failureDescription: => String, successDescription: => String): DescribedComputation[Boolean]