@@ -12,7 +12,7 @@ Scala 3 supports a superset of Scala 2 [extractors](https://www.scala-lang.org/f
1212
1313Extractors are objects that expose a method ` unapply ` or ` unapplySeq ` :
1414
15- ``` Scala
15+ ``` scala
1616def unapply [A ](x : T )(implicit x : B ): U
1717def unapplySeq [A ](x : T )(implicit x : B ): U
1818```
@@ -25,7 +25,7 @@ called variadic extractors, which enables variadic patterns.
2525
2626Fixed-arity extractors expose the following signature:
2727
28- ``` Scala
28+ ``` scala
2929def unapply [A ](x : T )(implicit x : B ): U
3030```
3131
@@ -36,7 +36,7 @@ The type `U` conforms to one of the following matches:
3636
3737Or ` U ` conforms to the type ` R ` :
3838
39- ``` Scala
39+ ``` scala
4040type R = {
4141 def isEmpty : Boolean
4242 def get : S
@@ -62,7 +62,7 @@ A usage of a fixed-arity extractor is irrefutable if one of the following condit
6262
6363Variadic extractors expose the following signature:
6464
65- ``` Scala
65+ ``` scala
6666def unapplySeq [A ](x : T )(implicit x : B ): U
6767```
6868
@@ -73,7 +73,7 @@ The type `U` conforms to one of the following matches:
7373
7474Or ` U ` conforms to the type ` R ` :
7575
76- ``` Scala
76+ ``` scala
7777type R = {
7878 def isEmpty : Boolean
7979 def get : S
@@ -167,7 +167,7 @@ object Nat:
167167- ` N > 1 ` is the maximum number of consecutive (parameterless ` def ` or ` val ` ) ` _1: P1 ... _N: PN ` members in ` U `
168168- Pattern-matching on exactly ` N ` patterns with types ` P1, P2, ..., PN `
169169
170- ``` Scala
170+ ``` scala
171171object ProdEmpty :
172172 def _1 : Int = ???
173173 def _2 : String = ???
@@ -184,7 +184,7 @@ object ProdEmpty:
184184
185185- ` U <: X ` , ` T2 ` and ` T3 ` conform to ` T1 `
186186
187- ``` Scala
187+ ``` scala
188188type X = {
189189 def lengthCompare (len : Int ): Int // or, `def length: Int`
190190 def apply (i : Int ): T1
@@ -219,7 +219,7 @@ object CharList:
219219- Pattern-matching on exactly ` >= N ` patterns, the first ` N - 1 ` patterns have types ` P1, P2, ... P(N-1) ` ,
220220 the type of the remaining patterns are determined as in Seq Pattern.
221221
222- ``` Scala
222+ ``` scala
223223class Foo (val name : String , val children : Int * )
224224object Foo :
225225 def unapplySeq (f : Foo ): Option [(String , Seq [Int ])] =
0 commit comments