Skip to content
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
6 changes: 2 additions & 4 deletions src/main/scala/monocle/LensExercises.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ object LensHelper {
*
* {{{
* import monocle.Lens
* val strNumber = Lens[Address, Int](_.strNumber)(n => a => a.copy(strNumber = n))
* val streetNumber = Lens[Address, Int](_.strNumber)(n => a => a.copy(strNumber = 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](_.strNumber)
* }}}
*
* @param name lens
Expand All @@ -65,7 +65,6 @@ object LensExercises extends FlatSpec with Matchers with Section {
* }}}
*/
def exerciseGetAndSet(res0: Int, res1: Address) = {

streetNumber.get(address) should be(res0)
streetNumber.set(5)(address) should be(res1)
}
Expand Down Expand Up @@ -121,7 +120,6 @@ object LensExercises extends FlatSpec with Matchers with Section {
* }}}
*/
def exerciseComposeLens(res0: Int, res1: Person) = {

(addressLens composeLens streetNumber).get(john) should be(res0)
(addressLens composeLens streetNumber).set(2)(john) should be(res1)
}
Expand Down