implicit class OptionSyntax[V] extends AnyRef
Syntax for treating Options
as indicators of success or failure in a computation.
The simplest usage is something like: myOption ~>? "Do I have Some?"
. The 'value' and log tree of the returned
treelog.LogTreeSyntax.DescribedComputation will indicate success or failure depending on the value of myOption
.
- Alphabetic
- By Inheritance
- OptionSyntax
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new OptionSyntax(option: Option[V])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
log(noneDescription: ⇒ String, someDescription: (V) ⇒ String): DescribedComputation[V]
Use different descriptions for the
Some
andNone
cases, providing the boxedSome
value to the function used to produce the description for theSome
case, so that it can be included in the description if you wish.Use different descriptions for the
Some
andNone
cases, providing the boxedSome
value to the function used to produce the description for theSome
case, so that it can be included in the description if you wish.If the option is
Some(x)
the 'value' of the returned DescribedComputation will be\/-(x)
, otherwise, the 'value' will be-\/(noneDescription)
. -
def
log(noneDescription: ⇒ String, someDescription: ⇒ String): DescribedComputation[V]
Use different descriptions for the
Some
andNone
cases.Use different descriptions for the
Some
andNone
cases.If the option is
Some(x)
the 'value' of the returned DescribedComputation will be\/-(x)
, otherwise, the 'value' will be-\/(noneDescription)
. -
def
log(description: String): DescribedComputation[V]
Use the same description whether the Option is
Some
orNone
.Use the same description whether the Option is
Some
orNone
. Equivalent tolog(description, description)
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
~>?(noneDescription: ⇒ String, someDescription: (V) ⇒ String): DescribedComputation[V]
Sugar for log(String, String)
-
def
~>?(noneDescription: ⇒ String, someDescription: ⇒ String): DescribedComputation[V]
Sugar for String) log(String, String)
-
def
~>?(description: String): DescribedComputation[V]
Sugar for log(String)
-
def
~>|[B](f: (V) ⇒ DescribedComputation[B], dflt: ⇒ DescribedComputation[Option[B]]): DescribedComputation[Option[B]]
Return a default treelog.LogTreeSyntax.DescribedComputation if
option
is aNone
.Return a default treelog.LogTreeSyntax.DescribedComputation if
option
is aNone
.If the option is
Some(x)
the 'value' of the returned DescribedComputation will be\/-(Some(x))
, otherwise, the returned treelog.LogTreeSyntax.DescribedComputation will bedflt
.
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated