Skip to content
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

fix typo #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 src/main/scala/monocle/LensExercises.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ object LensHelper {
*
* Let’s take a simple case class with two fields:
* {{{
* case class Address(strNumber: Int, streetName: String)
* case class Address(streetNumber: Int, streetName: String)
* }}}
*
* We can create a `Lens[Address, Int]` which zooms from an `Address` to its field `strNumber` by supplying a pair of functions:
* We can create a `Lens[Address, Int]` which zooms from an `Address` to its field `streetNumber` by supplying a pair of functions:
*
* - `get: Address => Int`
* - `set: Int => Address => Address`
*
* {{{
* import monocle.Lens
* val strNumber = Lens[Address, Int](_.strNumber)(n => a => a.copy(strNumber = n))
* val streetNumber = Lens[Address, Int](_.streetNumber)(n => a => a.copy(streetNumber = n))
* }}}
*
* This case is really straightforward so we automated the generation of `Lenses` from case classes using a macro:
* {{{
* import monocle.macros.GenLens
* val strNumber = GenLens[Address](_.strNumber)
* val streetNumber = GenLens[Address](_.streetNumber)
* }}}
*
* @param name lens
Expand Down Expand Up @@ -107,7 +107,7 @@ object LensExercises extends FlatSpec with Matchers with Section {
* def updateNumber(n: Int): Future[Int] = Future.successful(n + 1)
* }}}
* {{{
* strNumber.modifyF(updateNumber)(address)
* streetNumber.modifyF(updateNumber)(address)
* // res9: scala.concurrent.Future[Address] = Future(<not completed>)
* }}}
*
Expand Down