Commit 428209e
committed
copilot-core: Warn about future generic default for updateField. Refs #564.
Currently, using structs in Copilot requires defining instances of several type
classes. Defining those instances is unnecessarily cumbersome, and it exposes
the user to a substantial amount of Haskell even when they want to stay at the
level of the Copilot language.
In the previous commit, we added `Generic`-based defaults for several type
class methods, including the `updateField` method of `Struct`.
In the future, we plan to change the default implementation for `updateField`
such that it will require a `Generic` instance. This will break any existing
`Struct` instance that omits an implementation of `updateField` and also does
not define a `Generic` instance for the struct data type. Unfortunately, there
does not appear to be a way for GHC to warn about this combination of
properties.
This commit adds a verbal warning to the `updateField` Haddocks to make users
aware of this potential problem.1 parent b447d1c commit 428209e
1 file changed
+24
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
75 | 74 | | |
76 | | - | |
77 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
78 | 81 | | |
79 | | - | |
80 | | - | |
| 82 | + | |
81 | 83 | | |
82 | | - | |
83 | | - | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | | - | |
86 | | - | |
| 87 | + | |
| 88 | + | |
87 | 89 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
91 | 102 | | |
92 | 103 | | |
93 | 104 | | |
| |||
0 commit comments