From aa641871a9807f6f80675cb4d65fb70534119268 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Wed, 12 Mar 2014 16:46:59 -0700 Subject: SI-5370 PartialFunction is a Function with queryable domain --- 14-the-scala-standard-library.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to '14-the-scala-standard-library.md') diff --git a/14-the-scala-standard-library.md b/14-the-scala-standard-library.md index 5b408cff61..9b39d93ff1 100644 --- a/14-the-scala-standard-library.md +++ b/14-the-scala-standard-library.md @@ -378,11 +378,8 @@ trait Function$n$[-T_1, ..., -T_$n$, +R] { } ``` -A subclass of `Function1` represents partial functions, -which are undefined on some points in their domain. In addition to the -`apply` method of functions, partial functions also have a -`isDefined` method, which tells whether the function is defined -at the given argument: +The `PartialFunction` subclass of `Function1` represents functions that (indirectly) specify their domain. +Use the `isDefined` method to query whether the partial function is defined for a given input (i.e., whether the input is part of the function's domain). ``` class PartialFunction[-A, +B] extends Function1[A, B] { -- cgit v1.2.3