We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a61edc9 commit 1f5215cCopy full SHA for 1f5215c
docs/default_values.md
@@ -15,8 +15,13 @@ val noneList: Option[List[String]] = None
15
noneList.orEmpty // List[String]()
16
```
17
18
-To support other types, you just have to declare a new implicit value :
+To support other types, you have to declare a new implicit monoid for this type.
19
+
20
+Example with the BigDecimal type (already supported) :
21
22
```scala
-implicit def myCaseClassDefaultValue = new DefaultValue[MyCaseClass] { ... }
-```
23
+implicit val bigDecimalMonoid: Monoid[BigDecimal] = new Monoid[BigDecimal] {
24
+ override def empty: BigDecimal = BigDecimal(0)
25
+ override def compose(l: BigDecimal, r: BigDecimal): BigDecimal = l + r
26
+}
27
+```
0 commit comments