You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text/chapter6.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -314,7 +314,7 @@ Many standard type classes come with their own set of similar laws. The laws giv
314
314
315
315
### Deriving Instances
316
316
317
-
Rather than writing instances manually, you can let the compiler to most of the work for you. Take a look at this [Type Class Deriving guide](https://github.com/purescript/documentation/blob/master/guides/Type-Class-Deriving.md). That information will help you solve the following exercises.
317
+
Rather than writing instances manually, you can let the compiler do most of the work for you. Take a look at this [Type Class Deriving guide](https://github.com/purescript/documentation/blob/master/guides/Type-Class-Deriving.md). That information will help you solve the following exercises.
318
318
319
319
## Exercises
320
320
@@ -332,7 +332,7 @@ newtype Complex
332
332
333
333
2. (Easy) Derive an `Eq` instance for `Complex`. _Note_:You may instead write this instance manually, but why do more work if you don't have to?
334
334
335
-
3. (Medium) Define a `Semiring` instance for `Complex`. _Note_:You can use `wrap`and`over2` from [`Data.Newtype`](https://pursuit.purescript.org/packages/purescript-newtype/docs/Data.Newtype) to create a more concise solution.
335
+
3. (Medium) Define a `Semiring` instance for `Complex`. _Note_:You can use `wrap`and`over2` from [`Data.Newtype`](https://pursuit.purescript.org/packages/purescript-newtype/docs/Data.Newtype) to create a more concise solution.If you do so, you will also need to import `class Newtype` from `Data.Newtype` and derive a `Newtype` instance for `Complex`.
336
336
337
337
4. (Easy) Derive (via `newtype`) a `Ring` instance for `Complex`. _Note_:You may instead write this instance manually, but that's not as convenient.
0 commit comments