Better HN
topnewbestaskshowjobs
Log inSign up

emarx

2 karma · joined Nov 24, 2015 (11y ago) · 1 submissions

Submissions

comment 7y ago · link · parent

Monocle also ships with the macro annotation monocle.macros.Lenses that cuts out even more of the boilerplate and works with intellij's autocomplete

  import monocle.macros.Lenses

  @Lenses
  case class Foo(bar: Int)

  val x = Foo(1)
  assert(Foo.bar.get(x) == 1)