Monocle icon indicating copy to clipboard operation
Monocle copied to clipboard

NamedTuple support

Open MatteCarra opened this issue 1 year ago • 1 comments

Scala 3.5.0 introduced NamedTuples. I think Moncle should add support for them. Example:

val nt: NamedTuple[("b", "e", "d"), (Boolean, Boolean, Int)] = (b = false, e = true, d = 3)
val ntModified = nt.focus(_.e).replace(true)

MatteCarra avatar Jan 15 '25 12:01 MatteCarra

I found they plan to support this: https://contributors.scala-lang.org/t/named-tuples-field-updating/7116/16 Not sure if monocle's version will be more efficient or they can be equivalent?

beyondpie avatar May 18 '25 17:05 beyondpie