does anyone know if it’s possible to check if a partial function is defined for a certain value in kotlin? like scala’s
f.isDefinedAt
s
simon.vergauwen
05/21/2021, 11:13 AM
Hey Peter,
There is no concept of partial functions in Kotlin. In Scala, this relies on the pattern matching API.
What is your use case for partial functions in Kotlin? Typically there are other solutions to this issue.
p
Peter
05/21/2021, 9:32 PM
thanks @simon.vergauwen - i suppose that's true, no formal notion in kotlin.
it's for matching a deferred event to the current state in a state machine, there are probably a few ways to go about this..