author | wenzelm |
Fri, 21 May 2010 11:50:19 +0200 | |
changeset 37035 | 4834c3112788 |
parent 37034 | 9640f6546179 |
child 37036 | 49559c4e85f9 |
--- a/src/Pure/library.scala Fri May 21 11:16:01 2010 +0200 +++ b/src/Pure/library.scala Fri May 21 11:50:19 2010 +0200 @@ -17,6 +17,14 @@ object Library { + /* partial functions */ + + def undefined[A, B] = new PartialFunction[A, B] { + def apply(x: A): B = throw new NoSuchElementException("undefined") + def isDefinedAt(x: A) = false + } + + /* separate */ def separate[A](s: A, list: List[A]): List[A] =