@@ -84,7 +84,7 @@ For the `Tree` ADT from above the following `Mirror` instances will be automatic
8484
8585``` scala
8686// Mirror for Tree
87- new Mirror .Sum with
87+ new Mirror .Sum :
8888 type MirroredType = Tree
8989 type MirroredElemTypes [T ] = (Branch [T ], Leaf [T ])
9090 type MirroredMonoType = Tree [_]
@@ -96,7 +96,7 @@ new Mirror.Sum with
9696 case _ : Leaf [_] => 1
9797
9898// Mirror for Branch
99- new Mirror .Product with
99+ new Mirror .Product :
100100 type MirroredType = Branch
101101 type MirroredElemTypes [T ] = (Tree [T ], Tree [T ])
102102 type MirroredMonoType = Branch [_]
@@ -107,7 +107,7 @@ new Mirror.Product with
107107 new Branch (...)
108108
109109// Mirror for Leaf
110- new Mirror .Product with
110+ new Mirror .Product :
111111 type MirroredType = Leaf
112112 type MirroredElemTypes [T ] = Tuple1 [T ]
113113 type MirroredMonoType = Leaf [_]
@@ -212,7 +212,7 @@ instance for the appropriate ADT subtype using the auxiliary method `check` (4).
212212
213213``` scala
214214def eqSum [T ](s : Mirror .SumOf [T ], elems : List [Eq [_]]): Eq [T ] =
215- new Eq [T ] with
215+ new Eq [T ]:
216216 def eqv (x : T , y : T ): Boolean =
217217 val ordx = s.ordinal(x) // (3)
218218 (s.ordinal(y) == ordx) && check(elems(ordx))(x, y) // (4)
@@ -223,7 +223,7 @@ on the `Eq` instances for the fields of the data type (5),
223223
224224``` scala
225225def eqProduct [T ](p : Mirror .ProductOf [T ], elems : List [Eq [_]]): Eq [T ] =
226- new Eq [T ] with
226+ new Eq [T ]:
227227 def eqv (x : T , y : T ): Boolean =
228228 iterator(x).zip(iterator(y)).zip(elems.iterator).forall { // (5)
229229 case ((x, y), elem) => check(elem)(x, y)
@@ -254,13 +254,13 @@ object Eq:
254254 def iterator [T ](p : T ) = p.asInstanceOf [Product ].productIterator
255255
256256 def eqSum [T ](s : Mirror .SumOf [T ], elems : => List [Eq [_]]): Eq [T ] =
257- new Eq [T ] with
257+ new Eq [T ]:
258258 def eqv (x : T , y : T ): Boolean =
259259 val ordx = s.ordinal(x)
260260 (s.ordinal(y) == ordx) && check(elems(ordx))(x, y)
261261
262262 def eqProduct [T ](p : Mirror .ProductOf [T ], elems : => List [Eq [_]]): Eq [T ] =
263- new Eq [T ] with
263+ new Eq [T ]:
264264 def eqv (x : T , y : T ): Boolean =
265265 iterator(x).zip(iterator(y)).zip(elems.iterator).forall {
266266 case ((x, y), elem) => check(elem)(x, y)
0 commit comments