does anyone know if it’s possible to check if a pa...
# arrow
p
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
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
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..
f.isDefinedAt
just what came first to mind 😄