Help constructing scala files

Thanks for the comment. But it’s still not 100% clear to me.

My file Graph.scala looks like the following: I can use import Graph._ in another file Metro.scala, and therein I can instantiate the Graph class. However, I can neither use import Graph._ nor import Graph.Graph in the worksheet. Is that normal?

However if I create a dummy xyzzy object containing the contents of Graph.scala, then I can import into both Metro.scala and also the worksheet.

I’m sure the boiler plating is easy in the end, but I don’t really understand how to do it.

package Graph

import scala.collection.immutable
import scala.Function.const

case class Path[A](g:Graph[A], vertices:List[A],edges:Set[(A,A)]) {
  val numVertices = vertices.size
  ...stuff skipped...
}

case class Graph[A](Vertices: List[A], Edges: List[(A, A)]) {
  val vertexSet = Vertices.toSet
  type Edge = (A, A)
  type Matching = Set[Edge]
  ... stuff skipped ...
}