Skip to content

mostly fixing typos #2122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions _sips/sips/2017-09-20-opaque-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ signature of `apply` is redefined as `def apply(x: Double): Double`
and that `val x: Logarithm = Logarithm(1e7)` is instead `val x: Double
= Logarithm.apply(1e7)`.

Value classes can rewrite many instances `Logarithm` in terms of
Value classes can rewrite many instances of `Logarithm` in terms of
`Double`, including local variables, method parameters, return types,
and most fields. SIP-15 lays out the exact circumstances when these
rules occur, and extension methods ensure that boxing and unboxing
Expand Down Expand Up @@ -293,7 +293,7 @@ package object usesites {
}
```

Note that the rational for this encoding is to allow users to convert from the opaque type
Note that the rationale for this encoding is to allow users to convert from the opaque type
and the underlying type in constant time. Users have to be able to tag complex type structures
without having to reallocate, iterate over or inspect it.

Expand Down Expand Up @@ -670,8 +670,8 @@ package object groups {

opaque type Unordered[A] = A
object Unordered extends Wrapper[Unordered] {
def wraps[G[_], A](ga: G[A]): G[Reversed[A]] = ga
def unwrap[G[_], A](gfa: G[Reversed[A]]): G[A] = gfa
def wraps[G[_], A](ga: G[A]): G[Unordered[A]] = ga
def unwrap[G[_], A](gfa: G[Unordered[A]]): G[A] = gfa
implicit def unorderedOrdering[A]: Ordering[Unordered[A]] =
Ordering.by(_ => ())
}
Expand All @@ -693,7 +693,7 @@ example `Int`).
### Probability interval

Here's an example that demonstrates how opaque types can limit the
underlying type's range of values in a way that minimizes the require
underlying type's range of values in a way that minimizes the required
error-checking:

```scala
Expand Down