scalus.builtin.FromData
See theFromData companion trait
object FromData
FromData[A] derivation
Attributes
Members list
Value members
Deprecated methods
Attributes
- Deprecated
- true
Attributes
- Deprecated
- true
Derive FromData for an enum type
Derive FromData for an enum type
Value parameters
- conf
-
a partial function mapping tag to constructor function, like
Attributes
- Returns
-
a FromData instance
- Example
-
enum Adt: case A case B(b: Boolean) case C(a: Adt, b: Adt) given FromData[Adt] = FromData.deriveEnum[Adt] { case 0 => _ => Adt.A case 1 => FromData.deriveConstructor[Adt.B] case 2 => FromData.deriveConstructor[Adt.C] }
- Deprecated
- true
Derive FromData for an enum type
Derive FromData for an enum type
Attributes
- Returns
-
a FromData instance
- Example
-
enum Adt: case A case B(b: Boolean) case C(a: Adt, b: Adt) given FromData[Adt] = FromData.deriveEnum[Adt]
- Deprecated
- true
Givens
Givens
In this article