equal
deleted
inserted
replaced
15 { |
15 { |
16 class Duplicate[Key](x: Key) extends Exception |
16 class Duplicate[Key](x: Key) extends Exception |
17 class Undefined[Key](x: Key) extends Exception |
17 class Undefined[Key](x: Key) extends Exception |
18 class Cycles[Key](cycles: List[List[Key]]) extends Exception |
18 class Cycles[Key](cycles: List[List[Key]]) extends Exception |
19 |
19 |
20 def empty[Key, A]: Graph[Key, A] = new Graph[Key, A](Map.empty) |
20 private val empty_val: Graph[Any, Nothing] = new Graph[Any, Nothing](Map.empty) |
|
21 def empty[Key, A]: Graph[Key, A] = empty_val.asInstanceOf[Graph[Key, A]] |
21 } |
22 } |
22 |
23 |
23 |
24 |
24 class Graph[Key, A] private(rep: Map[Key, (A, (Set[Key], Set[Key]))]) |
25 class Graph[Key, A] private(rep: Map[Key, (A, (Set[Key], Set[Key]))]) |
25 extends Iterable[(Key, (A, (Set[Key], Set[Key])))] |
26 extends Iterable[(Key, (A, (Set[Key], Set[Key])))] |