Created
July 15, 2011 21:49
-
-
Save gseitz/1085610 to your computer and use it in GitHub Desktop.
InYourCase: autogenerated scalaz.Lens'es for case classes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Foo(bar: Int) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> import test.Foo | |
import test.Foo | |
scala> val foo = Foo(17) | |
foo: test.Foo = Foo(17) | |
scala> :type Foo.bar | |
scalaz.Lens[test.Foo,Int] | |
scala> Foo.bar.get(foo) | |
res0: Int = 17 | |
scala> Foo.bar.set(foo, 42) | |
res1: test.Foo = Foo(42) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment