com.mchange.conveniences.boolean.core.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of conveniences_3 Show documentation
Show all versions of conveniences_3 Show documentation
Conveniences, usually extension methods, that seem useful across projects.
The newest version!
package com.mchange.conveniences.boolean
val UnitOption : Option[Unit] = Some( () )
extension ( b : Boolean )
def toOption : Option[Unit] = if b then UnitOption else None
def tf[A]( ifTrue : =>A)( ifFalse : =>A ) = if b then ifTrue else ifFalse