SafeBool

trait SafeBool[B <: SafeBool[B]] extends Product with Serializable

Boolean isomorphism.

Mix into the base type and override companion there.

Examples:

   sealed trait Enabled extends SafeBool[Enabled] {
     override final def companion = Enabled
   }

   case object Enabled extends Enabled with SafeBool.Object[Enabled] {
     override def positive = Enabled
     override def negative = Disabled
   }

   case object Disabled extends Enabled
   sealed abstract class Permission extends SafeBool.WithBoolOps[Permission] {
     override final def companion = Permission
   }

   case object Allow extends Permission
   case object Deny extends Permission

   object Permission extends SafeBool.Object[Permission] {
     override def positive = Allow
     override def negative = Deny
   }
Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
trait WithBoolOps[B]
trait Enabled
object Disabled.type
object Enabled.type
trait Validity
object Invalid.type
object Valid.type
B

Value members

Abstract methods

Concrete methods

final def fnToThisWhen[A](f: A => Boolean): A => B
@inline
final def is(b: B): Boolean
final def unary_!: B
@inline
final def when(cond: Boolean): B
final def whenAllAre(bs: B*): B
final def whenAnyAre(bs: B*): B

Inherited methods

def canEqual(that: Any): Boolean
Inherited from:
Equals
def productArity: Int
Inherited from:
Product
def productElement(n: Int): Any
Inherited from:
Product
def productElementName(n: Int): String
Inherited from:
Product
def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product
def productPrefix: String
Inherited from:
Product