block by nicerobot 4be49f572cecea1da0df

Scala PartialFunction and Partially-applied functions

Partial functions are largely about function composition. Specifically, being able to compose different parts of a function, then either call a fully defined function or handle the possibility of an undefined value.

Note: Partially-applied functions and partial functions are similar in that they are functions.

While I’ve seen plenty of comments stating partial application is not related to partial functions. I somewhat disagree. A specific partial application can be thought of as a restructured implementation of partial functions. Another way to think of it is that partial application ensures that a particular input of a partial function execution is defined for the input.

Main.out

Main.scala