Luke
06/22/2022, 2:50 PMval getId: (MyClass) -> String? = MyClass.somePath.id::getOrNull
, which works, but I would prefer to call a method instead of ::getOrNull
to return a lambda directly so I don't have to explicit the variable type.simon.vergauwen
06/22/2022, 4:17 PMlift
in their APIs.
https://arrow-kt.io/docs/apidocs/arrow-optics/arrow.optics/-p-lens/index.htmlLuke
06/22/2022, 5:32 PMlift
generates a function to modify the source right? I want to generate a function to get the value in the sourcesimon.vergauwen
06/23/2022, 6:54 AM::getOrNull
. I'm not sure what you mean with to explicit the variable type
.
Is it not simply returning (MyClass) -> String?
?Luke
06/23/2022, 2:04 PMKFunction1<MyClass, String?>
. I just assumed I couldn't use it as a lambda but I guess I can. Thanks for the help