equal
deleted
inserted
replaced
5 |
5 |
6 |
6 |
7 // type abbreviation for partial functions |
7 // type abbreviation for partial functions |
8 type :=>[A, B] = PartialFunction[A, B] |
8 type :=>[A, B] = PartialFunction[A, B] |
9 |
9 |
10 // return an empty set when not defined |
10 // return an empty set, when parial function is not defined |
11 def applyOrElse[A, B](f: A :=> Set[B], x: A) : Set[B] = |
11 def applyOrElse[A, B](f: A :=> Set[B], x: A) : Set[B] = |
12 Try(f(x)) getOrElse Set[B]() |
12 Try(f(x)) getOrElse Set[B]() |
13 |
13 |
14 |
14 |
15 // NFAs |
15 // NFAs |