Skip to content

Commit 00dde24

Browse files
committed
rfc, unreservations: fix mistakes re. priv.
1 parent d797c44 commit 00dde24

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

text/0000-unreservations-2018.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ This keyword used to be used for `pure fn`, that is: as an effect.
7474

7575
When *generic associated types* (GATs) lands, it is likely that people would
7676
like to use this in their [applicative functor][applicative] and monad libraries,
77-
which speaks in favor of unreserving `pure`. This use case explicitly mentioned by [`@ubsan`](https://github.com/ubsan/) who requested that the keyword be unreserved for this purpose.
77+
which speaks in favour of unreserving `pure`. This use case explicitly mentioned by [`@ubsan`](https://github.com/ubsan/) who requested that the keyword be unreserved for this purpose.
7878

7979
### Potential drawbacks
8080

@@ -117,9 +117,9 @@ fn foo() -> Result<i32, Error> {
117117

118118
[Applicative laws]: https://en.wikibooks.org/wiki/Haskell/Applicative_functors#Applicative_functor_laws
119119

120-
While you might think that Haskell developers would be in favor of this,
120+
While you might think that Haskell developers would be in favour of this,
121121
that does not seem to be the case. Haskell developers over at
122-
`#haskell @ freenode` were not particularly in favor of this use as `pure`
122+
`#haskell @ freenode` were not particularly in favour of this use as `pure`
123123
in this context as `pure` does not respect the [Applicative laws].
124124
The desugaring is also not particularly obvious when `pure` is used.
125125
If we did add sugar for explicit `Ok`-wrapping, we'd probably go with something
@@ -241,9 +241,13 @@ pub struct Bar {
241241
}
242242
```
243243

244-
Since everything is already private by default, `priv` would only be an extra
245-
hint that users can use to be more explict, but serves no other purpose.
246-
Further, we could possibly use `pub(self)` for `priv` instead.
244+
Since fields are already private by default, `priv` would only be an extra
245+
hint that users can use to be more explicit, but serves no other purpose.
246+
Note however that `enum` variants are not private by default.
247+
Neither are items in `trait`s. Annotating items as `priv` in traits could
248+
potentially be useful for internal `fn`s used in provided `fn` implementations.
249+
However, we could possibly use `pub(self)` instead of `priv`.
250+
247251

248252
Permitting `priv` could also be confusing for readers. Consider for example:
249253

0 commit comments

Comments
 (0)