Kev
03/22/2024, 12:37 PM@optics
data class Foo(val id: UUID, val name: String, val bars: List<Bar>) {
companion object
}
@optics
data class Bar(val id: UUID, val name: String, val visited: Boolean) {
companion object
}
I get as far as Every.list<Foo>().bars.every(Every.list())
and it bombs out on the second every method with Overload resolution ambiguity. All these functions match.
I’m not sure what exactly I’m doing wrong and the resources on the website don’t go into detail with traversing lists within lists (I don’t see why it should be any different, I must be missing something obvious).Kev
03/22/2024, 12:46 PMfun List<Foo>.visit(id: UUID): List<Foo> =
Every.list<Foo>().bars.modify(this) { bar ->
bar.map { Bar(it.id, it.name, it.id == id) }
}