Skip to content

Commit 9bd1fd1

Browse files
committed
change to Scala 3 Only.
1 parent 6552e73 commit 9bd1fd1

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

_overviews/scala3-book/domain-modeling-fp.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ In Scala, describing the data model of a programming problem is simple:
5959
Data that simply consists of different alternatives, like crust size, crust type, and toppings, is concisely modeled with the Scala 3 `enum` construct:
6060

6161
{% tabs data_1 %}
62-
{% tab 'Scala 3 only' for=data_1 %}
62+
{% tab 'Scala 3 Only' for=data_1 %}
6363

6464
```scala
6565
enum CrustSize:
@@ -82,24 +82,8 @@ enum Topping:
8282
A pizza can be thought of as a _compound_ container of the different attributes above.
8383
We can use a `case` class to describe that a `Pizza` consists of a `crustSize`, `crustType`, and potentially multiple `Topping`s:
8484

85-
{% tabs data_2 class=tabs-scala-version %}
86-
{% tab 'Scala 2' for=data_2 %}
87-
88-
```scala
89-
import CrustSize._
90-
import CrustType._
91-
import Topping._
92-
93-
case class Pizza(
94-
crustSize: CrustSize,
95-
crustType: CrustType,
96-
toppings: Seq[Topping]
97-
)
98-
```
99-
100-
{% endtab %}
101-
102-
{% tab 'Scala 3' for=data_2 %}
85+
{% tabs data_2 %}
86+
{% tab 'Scala 3 Only' for=data_2 %}
10387

10488
```scala
10589
import CrustSize.*
@@ -325,7 +309,7 @@ A first approach is to define the behavior---the functions---in a companion obje
325309
With this approach, in addition to the enumeration or case class you also define an equally named companion object that contains the behavior.
326310

327311
{% tabs org_1 %}
328-
{% tab 'Scala 3 only' for=org_1 %}
312+
{% tab 'Scala 3 Only' for=org_1 %}
329313

330314
```scala
331315
case class Pizza(
@@ -660,7 +644,7 @@ This can have multiple advantages:
660644
Let us revisit our example once more.
661645

662646
{% tabs module_7 %}
663-
{% tab 'Scala 3 only' for=module_7 %}
647+
{% tab 'Scala 3 Only' for=module_7 %}
664648

665649
```scala
666650
case class Pizza(

0 commit comments

Comments
 (0)