From 4f0f473cf45a4c25309db4cf3f1eb6ab5b9b1443 Mon Sep 17 00:00:00 2001 From: bishabosha Date: Tue, 11 Jun 2019 01:07:11 +0200 Subject: [PATCH] fix closing comment tag; enum syntax --- docs/docs/reference/contextual/derivation.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/docs/reference/contextual/derivation.md b/docs/docs/reference/contextual/derivation.md index 0b3be9689149..7aeb214f6cba 100644 --- a/docs/docs/reference/contextual/derivation.md +++ b/docs/docs/reference/contextual/derivation.md @@ -48,16 +48,17 @@ to that shape. A `Mirror` delegate is generated automatically for - case classes and objects, - enums and enum cases, - sealed traits or classes that have only case classes and case objects as children. -``` -The description that follows gives a low-level way to define type class +The description that follows gives a low-level way to define a type class. ### The Shape Type 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: + ```scala Cases[( 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]`. For instance, the definition ```scala enum Result[+T, +E] derives Logging { - case class Ok[T](result: T) - case class Err[E](err: E) + case Ok[T](result: T) + case Err[E](err: E) } ``` would produce: