progs/lecture4.scala
changeset 242 e6b34f617915
parent 226 5e489c9fe47b
child 243 9bb36426c781
--- a/progs/lecture4.scala	Fri Dec 07 08:54:34 2018 +0000
+++ b/progs/lecture4.scala	Fri Dec 07 12:17:27 2018 +0000
@@ -308,6 +308,9 @@
   def next(q: A, c: C) : Set[A] = 
     Try(delta(q, c)) getOrElse Set[A]() 
 
+  def nexts(qs: Set[A], c: C) : Set[A] =
+    qs.flatMap(next(_, c))
+
   // depth-first version of accepts
   def search(q: A, s: List[C]) : Boolean = s match {
     case Nil => fins(q)