Skip to content

Commit 47c126a

Browse files
authored
Merge pull request #6673 from bishabosha/fix-deriving-docs
Fix syntax for derivation docs
2 parents 5cdf130 + 4f0f473 commit 47c126a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/docs/reference/contextual/derivation.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,17 @@ to that shape. A `Mirror` delegate is generated automatically for
4848
- case classes and objects,
4949
- enums and enum cases,
5050
- sealed traits or classes that have only case classes and case objects as children.
51-
```
5251

5352
<!---
5453
This is all a user of typeclass derivation has to know. The rest of this page contains information needed to be able to write a typeclass that can appear in a `derives` clause. In particular, it details the means provided for the implementation of data generic `derived` methods.
54+
--->
5555

56-
The description that follows gives a low-level way to define type class
56+
The description that follows gives a low-level way to define a type class.
5757

5858
### The Shape Type
5959

6060
For every class with a `derives` clause, the compiler computes the shape of that class as a type. For example, here is the shape type for the `Tree[T]` enum:
61+
6162
```scala
6263
Cases[(
6364
Case[Branch[T], (Tree[T], Tree[T])],
@@ -112,8 +113,8 @@ where the right hand side of `Shape` is the shape type of `C[T_1,...,T_n]`.
112113
For instance, the definition
113114
```scala
114115
enum Result[+T, +E] derives Logging {
115-
case class Ok[T](result: T)
116-
case class Err[E](err: E)
116+
case Ok[T](result: T)
117+
case Err[E](err: E)
117118
}
118119
```
119120
would produce:

0 commit comments

Comments
 (0)