I'm trying to follow this documentation about Lens
in Arrow. However when I try to write a Lens
data class Player(val health: Int)
val playerLens: Lens<Player, Int> = Lens(
get = { player -> player.health },
set = { player, value -> player.copy(health = value) }
)
I get the following error:
4 type arguments expected for operator fun <S, T, A, B> invoke(): PLens<S, T, A, B>
I see that Lens<S, T>
is a typealias for PLens<S, S, T, T>
, so why this compilation error?
Kotlin version 1.3.50
Arrow Optics version 0.10.0