Skip to content

Instantly share code, notes, and snippets.

@deanwampler
Created February 26, 2021 19:59
Show Gist options
  • Save deanwampler/7fe65565c8d4974e3188308446dbd887 to your computer and use it in GitHub Desktop.
Save deanwampler/7fe65565c8d4974e3188308446dbd887 to your computer and use it in GitHub Desktop.
// Input a sequence of any element type and constructs a string:
def tos(seq: Seq[?]): String = seq.mkString("[", ", ", "]")
tos(Vector(1,2,3)) // "[1, 2, 3]"
// A reminder of given imports, but specifically how to import all
// givens of a parameterized type:
trait Marker[T]
object Obj:
given Marker[Int] with {}
given Marker[List[?]] with {}
import Obj.{given Marker[Int]} // Import just the Marker[Int]
import Obj.{given Marker[?]} // Import all given Markers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment