Hacker News new | ask | show | jobs
by emarx 2733 days ago
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)