|
Scala example source code file (ThreeValues.scala)
The ThreeValues.scala Scala example source codepackage scala package reflect.internal.util /** A simple three value type for booleans with an unknown value */ object ThreeValues { type ThreeValue = Byte final val YES = 1 final val NO = -1 final val UNKNOWN = 0 def fromBoolean(b: Boolean): ThreeValue = if (b) YES else NO def toBoolean(x: ThreeValue): Boolean = x == YES } Other Scala source code examplesHere is a short list of links related to this Scala ThreeValues.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.