package misc
- Alphabetic
- Public
- All
Type Members
-
final
case class
Boxing
[-A, +B](fun: (A) ⇒ B) extends AnyVal with Product with Serializable
Author: ghik Created: 07/01/16.
-
trait
Delegation
[A, B] extends AnyRef
A typeclass which witnesses that type
Acan be wrapped into trait or abstract classB - trait LowPrioBoxing extends AnyRef
- trait LowPrioUnboxing extends AnyRef
-
final
class
NOpt
[+A] extends AnyVal with Serializable
Like Opt but does have a counterpart for
Some(null). - trait NamedEnum extends Any
-
trait
NamedEnumCompanion
[T <: NamedEnum] extends SealedEnumCompanion[T]
Base trait for companion objects of sealed traits that serve as named enums
-
final
class
Opt
[+A] extends AnyVal with Serializable
Like
Optionbut avoids boxing and treatsnullas no value.Like
Optionbut avoids boxing and treatsnullas no value. Therefore, there is no equivalent forSome(null).Author: ghik Created: 07/01/16.
-
final
class
OptRef
[+A >: Null] extends AnyVal with Serializable
Like Opt but has better Java interop thanks to the fact that wrapped value has type
Ainstead ofAny.Like Opt but has better Java interop thanks to the fact that wrapped value has type
Ainstead ofAny. For example, Scala method defined like this:def takeMaybeString(str: OptRef[String]): Unit
will be seen by Java as:
public void takeMaybeString(String str);and
nullwill be used to represent absence of value.This comes at the cost of
Ahaving to be a nullable type. Also, empty value is represented internally usingnullwhich unfortunately makes OptRef suffer from SI-7396 (hashCodefails onOptRef.Emptywhich means that you can't add OptRef values into hash sets or use them as hash map keys).Author: ghik Created: 07/01/16.
-
trait
OrderedEnum
extends Any
Trait to be extended by enums whose values are ordered by declaration order.
Trait to be extended by enums whose values are ordered by declaration order. Ordering is derived from SourceInfo object, which is typically accepted as an implicit, e.g.
sealed abstract class MyOrderedEnum(implicit val sourceInfo: SourceInfo) extends OrderedEnum object MyOrderedEnum { case object First extends MyOrderedEnum case object Second extends MyOrderedEnum case object Third extends MyOrderedEnum val values: List[MyOrderedEnum] = caseObjects }
In the example above,
valuesis guaranteed to returnFirst,SecondandThirdobjects in exactly that order. -
abstract
class
SamCompanion
[T, F] extends AnyRef
Author: ghik Created: 23/11/15.
-
trait
SealedEnumCompanion
[T] extends AnyRef
Base trait for companion objects of sealed traits that serve as enums, i.e.
Base trait for companion objects of sealed traits that serve as enums, i.e. their only values are case objects. For example:
sealed trait SomeEnum object SomeEnum extends SealedEnumCompanion[SomeEnum] { case object FirstValue extends SomeEnum case object SecondValue extends SomeEnum case object ThirdValue extends SomeEnum // it's important to give explicit type here val values: List[SomeEnum] = caseObjects }
-
case class
SourceInfo
(filePath: String, fileName: String, offset: Int, line: Int, column: Int, lineContent: String, enclosingSymbols: List[String]) extends Product with Serializable
Macro-materialized implicit value that provides information about callsite source file position.
Macro-materialized implicit value that provides information about callsite source file position. It can be used in runtime for logging and debugging purposes. Similar to Scalactic's
Position, but contains more information. -
abstract
class
TypedKey
[T] extends AnyRef
Base class for sealed enums which can be used as key type for a TypedMap.
- trait TypedKeyCompanion [K[X] <: TypedKey[X]] extends SealedEnumCompanion[K[_]]
-
final
class
TypedMap
[K[_]] extends AnyVal
Author: ghik Created: 21/04/16.
- final case class Unboxing [+A, -B](fun: (B) ⇒ A) extends AnyVal with Product with Serializable
Value Members
-
object
Bidirectional
Creates reversed partial function.
- object Boxing extends LowPrioBoxing with Serializable
- object Delegation
-
object
Implicits
Author: ghik Created: 19/09/16.
- object NOpt extends Serializable
- object Opt extends Serializable
- object OptRef extends Serializable
- object OrderedEnum
-
object
Sam
Author: ghik Created: 24/11/15.
- object SamCompanion
-
object
SealedUtils
Author: ghik Created: 11/12/15.
- object SourceInfo extends Serializable
- object TypedMap
- object Unboxing extends LowPrioUnboxing with Serializable