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: language/Type-Classes.md
+20-20Lines changed: 20 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -170,33 +170,33 @@ Currently, instances for the following classes can be derived by the compiler:
170
170
171
171
If you would like your newtype to defer to the instance that the underlying type uses for a given class, then you can use newtype deriving via the `derive newtype` keywords.
172
172
173
-
For example, let's say you want to add two `Points` values using the `Semiring` instance of the wrapped `Int`.
173
+
For example, let's say you want to add two `Score` values using the `Semiring` instance of the wrapped `Int`.
Note that we can use either of these options to derive an `Eq` instance for a `newtype`, since `Eq` has built-in compiler support. They are equivalent in this case.
196
196
197
197
```purs
198
-
derive instance eqPoints :: Eq Points
199
-
derive newtype instance eqPoints :: Eq Points
198
+
derive instance eqScore :: Eq Score
199
+
derive newtype instance eqScore :: Eq Score
200
200
```
201
201
202
202
### Deriving from `Generic`
@@ -227,12 +227,12 @@ Note that the `show` output string can be copy-pasted to reconstruct the origina
More information on Generic deriving is available [in the generics-rep library documentation](https://pursuit.purescript.org/packages/purescript-generics-rep). See this [blog post](https://harry.garrood.me/blog/write-your-own-generics/) for a tutorial on how to write your own `generic` functions.
0 commit comments