Boolean isomorphism.
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