Skip to content

Commit

Permalink
Fix links in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Feb 4, 2022
1 parent 0b91d4e commit 4542aef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -34,7 +34,7 @@ The compiler will synthesize an instance of `TupledFunction[F, G]` if:
Examples
--------
`TupledFunction` can be used to generalize the `Function1.tupled`, ... `Function22.tupled` methods to functions of any arities.
The following defines `tupled` as [extension method](../contextual/extension-methods.html) ([full example](https://github.com/lampepfl/dotty/blob/master/tests/run/tupled-function-tupled.scala)).
The following defines `tupled` as [extension method](../contextual/extension-methods.html) ([full example](https://github.com/lampepfl/dotty/blob/main/tests/run/tupled-function-tupled.scala)).

```scala
/** Creates a tupled version of this function: instead of N arguments,
Expand All @@ -48,7 +48,7 @@ extension [F, Args <: Tuple, R](f: F)
def tupled(using tf: TupledFunction[F, Args => R]): Args => R = tf.tupled(f)
```

`TupledFunction` can be used to generalize the `Function.untupled` to a function of any arities ([full example](https://github.com/lampepfl/dotty/blob/master/tests/run/tupled-function-untupled.scala))
`TupledFunction` can be used to generalize the `Function.untupled` to a function of any arities ([full example](https://github.com/lampepfl/dotty/blob/main/tests/run/tupled-function-untupled.scala))

```scala
/** Creates an untupled version of this function: instead of a single argument of type [[scala.Tuple]] with N elements,
Expand All @@ -64,7 +64,7 @@ extension [F, Args <: Tuple, R](f: Args => R)
def untupled(using tf: TupledFunction[F, Args => R]): F = tf.untupled(f)
```

`TupledFunction` can also be used to generalize the [`Tuple1.compose`](https://github.com/lampepfl/dotty/blob/master/tests/run/tupled-function-compose.scala) and [`Tuple1.andThen`](https://github.com/lampepfl/dotty/blob/master/tests/run/tupled-function-andThen.scala) methods to compose functions of larger arities and with functions that return tuples.
`TupledFunction` can also be used to generalize the [`Tuple1.compose`](https://github.com/lampepfl/dotty/blob/main/tests/run/tupled-function-compose.scala) and [`Tuple1.andThen`](https://github.com/lampepfl/dotty/blob/main/tests/run/tupled-function-andThen.scala) methods to compose functions of larger arities and with functions that return tuples.

```scala
/** Composes two instances of TupledFunction into a new TupledFunction, with this function applied last.
Expand Down
2 changes: 1 addition & 1 deletion docs/sidebar.yml
Expand Up @@ -116,7 +116,7 @@ sidebar:
- page: docs/reference/experimental/named-typeargs.md
- page: docs/reference/experimental/numeric-literals.md
- page: docs/reference/experimental/explicit-nulls.md
- page: docs/reference/other-new-features/tupled-function.md
- page: docs/reference/experimental/tupled-function.md
- page: docs/reference/syntax.md
- title: Language Versions
index: docs/reference/language-versions/language-versions.md
Expand Down

0 comments on commit 4542aef

Please sign in to comment.