Reading Arrow Lens' docs and I'm a bit confused. Docs mention that
set
has type
A -> S -> T
, but actual
set
implementations seem to have it reversed:
S -> A -> T
.
Screenshots are from: api docs
Similarly main page of Arrow Optics mentions
set: A -> S -> S
, but then has an example of
playerLens.set(player, health)
. Am I reading this wrong or is this a little bug?
s
simon.vergauwen
02/10/2022, 2:48 PM
Hey @dimsuz,
That piece of the documentation can definitely be improved but Arrow Optics is the oldest stable library by far.. Sadly it didn't get very much attention/love, especially the docs.
The signatures there should probably be updated to the latest constructor that we have in Arrow Optics.
operator fun <S, T, A, B> invoke(get: (S) -> A, set: (S, B) -> T): PLens<S, T, A, B>