Provides default values of case class-like types, as a HList of options.
Provides default values of case class-like types, as a HList of options.
Unlike Default
, Out
is made of elements like Option[...]
instead of None.type
and Some[...]
.
Thus, the availability of default values cannot be checked through types, only through values (via the apply
method).
This representation can be more convenient to deal with when one only check the default values at run-time.
Method apply
provides the HList of default values, typed as Out
.
Example
case class CC(i: Int, s: String = "b") val default = Default.AsOptions[CC] // default.Out is Option[Int] :: Option[String] :: HNil // default() returns // None :: Some("b") :: HNil // typed as default.Out
Provides default values of case class-like types, as a record.
Provides default values of case class-like types, as a record.
Type Out
is a record type, having one element per field with a default value. Labels
come from the available DefaultSymbolicLabelling[T]
, and values are the default values
themselves.
Method apply
provides the record of default values, typed as Out
.
Example
case class CC(i: Int, s: String = "b") val default = Default.AsRecord[CC] // default.Out is Record.`'s -> String`.T // default() returns Record(s = "b")