Skip to content

Update relationship-implicits.md #7552

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 1 commit into from
Nov 15, 2019
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
27 changes: 13 additions & 14 deletions docs/docs/reference/contextual/relationship-implicits.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,21 @@ Given instances can be mapped to combinations of implicit objects, classes and i
final implicit def ListOrd[T](implicit ord: Ord[T]): ListOrd[T] = new ListOrd[T]
```
3. Alias givens map to implicit methods or implicit lazy vals. If an alias has neither type parameters nor a given clause,
it is treated as a lazy val, unless the right hand side is a simple reference, in which case we can use a forwarder to that
reference without caching it.
it is treated as a lazy val, unless the right hand side is a simple reference, in which case we can use a forwarder to
that reference without caching it.

Examples:

```scala
given global: ExecutionContext = new ForkJoinContext()
Examples:
```scala
given global: ExecutionContext = new ForkJoinContext()

val ctx: Context
given Context = ctx
```
would map to
```scala
final implicit lazy val global: ExecutionContext = new ForkJoinContext()
final implicit def given_Context = ctx
```
val ctx: Context
given Context = ctx
```
would map to
```scala
final implicit lazy val global: ExecutionContext = new ForkJoinContext()
final implicit def given_Context = ctx
```

### Anonymous Given Instances

Expand Down