Commit ae06e79
authored
Update docs (#31)
See also #23, #29
I thought about this a bit more, and I think the reasoning for why refs
are effectful is more persuasive when viewed through the lens of purity
rather than of referential transparency, so I've updated the docs
accordingly.
I am reluctant to include code examples illustrating why Refs are
effectful here, because I think people may skim the page looking for
code examples, and in the absence of code examples which describe the
real API, I think code examples which illustrate a hypothetical version
of the API which doesn't actually exist may do more harm than good.
I am also leaning towards not including @natefaubion's example (where
you can violate the type system by defining a reference with a
polymorphic type and specializing it after the fact), since it's hard to
illustrate without a code example, and I think it's unlikely to be
useful to most people who just want to make use of the Ref API, which is
the group I think we should be considering to be our target audience
here.1 parent 8ab49d5 commit ae06e79
1 file changed
+21
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
4 | 21 | | |
5 | 22 | | |
6 | 23 | | |
| |||
25 | 42 | | |
26 | 43 | | |
27 | 44 | | |
28 | | - | |
| 45 | + | |
29 | 46 | | |
30 | 47 | | |
31 | 48 | | |
| |||
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
| 60 | + | |
43 | 61 | | |
44 | 62 | | |
45 | 63 | | |
| |||
0 commit comments