Skip to content

Commit ad956d9

Browse files
Add that over2 and wrap need a Newtype instance of Complex. (#278)
* Add that over2 and wrap need a Newtype instance of Complex. * Quick do intead of to typo fix Co-authored-by: milesfrain <[email protected]>
1 parent 11e2b50 commit ad956d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

text/chapter6.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ Many standard type classes come with their own set of similar laws. The laws giv
314314

315315
### Deriving Instances
316316

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.
318318

319319
## Exercises
320320

@@ -332,7 +332,7 @@ newtype Complex
332332

333333
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?
334334

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`.
336336

337337
4. (Easy) Derive (via `newtype`) a `Ring` instance for `Complex`. _Note_: You may instead write this instance manually, but that's not as convenient.
338338

0 commit comments

Comments
 (0)