Scala's partial function

May 19, 2013 08:50


For some reason, I always stumble upon Scala's term "partial function".  I always tend to think about it as "partial function application", i.e. currying.  But they use it for a function that doesn't have a fallback in the pattern matching clause and doesn't match some of combinations of input arguments.  The feature itself is great (especially being able to check whether specific set of arguments will be handled by the function or not), but the term is confusing.

Maybe the term comes from standard area of math?  Ah, OK, it really does - http://en.wikipedia.org/wiki/Partial_function

Oh well.
Previous post Next post
Up