Reading Arrow Lens' docs and I'm a bit confused. D...
# arrow
d
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
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>
https://arrow-kt.io/docs/apidocs/arrow-optics/arrow.optics/-p-lens/-companion/invoke.html
Please feel free to create a ticket for this, or a PR if you're up for it 🙏
d
got it! If I'll manage sometime will create a PR!
👍 1
👍🏻 1