Skip to content

Commit 991ea62

Browse files
authored
reduced number of Logarithm
1 parent 95fa9cb commit 991ea62

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/docs/reference/other-new-features/opaques.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: "Opaque Type Aliases"
66
Opaque types aliases provide type abstraction without any overhead. Example:
77

88
```scala
9-
object Logarithms:
9+
object MyMath:
1010

1111
opaque type Logarithm = Double
1212

@@ -27,7 +27,7 @@ object Logarithms:
2727
def + (y: Logarithm): Logarithm = Logarithm(math.exp(x) + math.exp(y))
2828
def * (y: Logarithm): Logarithm = x + y
2929

30-
end Logarithms
30+
end MyMath
3131
```
3232

3333
This introduces `Logarithm` as a new abstract type, which is implemented as `Double`.
@@ -41,7 +41,7 @@ They convert from `Double`s to `Logarithm` values. Moreover, an operation `toDou
4141
The following operations would be valid because they use functionality implemented in the `Logarithms` object.
4242

4343
```scala
44-
import Logarithms.Logarithm
44+
import MyMath.Logarithm
4545

4646
val l = Logarithm(1.0)
4747
val l2 = Logarithm(2.0)

0 commit comments

Comments
 (0)