Skip to content

Commit

Permalink
Improve example
Browse files Browse the repository at this point in the history
  • Loading branch information
cvogt committed May 31, 2016
1 parent b90e412 commit d4339fd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Expand Up @@ -20,21 +20,22 @@ val a = A(B(C(3)))

#### Easy updates using `.lens`
```scala
a.lens(_.b.c.d).set( 5 )
a.lens(_.b.c.d).modify( _ + 2 )
A(B(C(5))) == a.lens(_.b.c.d).set( 5 )
A(B(C(6))) == a.lens(_.b.c.d).modify( _ + 3 )
```

#### Verbose update using `.copy`
#### Verbose updates using `.copy`
```scala
a.copy(
A(B(C(5))) == a.copy(
b = a.b.copy(
c = a.b.c.copy(
d = 5
)))
a.copy(

A(B(C(6))) == a.copy(
b = a.b.copy(
c = a.b.c.copy(
d = a.b.c.d + 2
d = a.b.c.d + 3
)))
```

0 comments on commit d4339fd

Please sign in to comment.