Skip to content

Instantly share code, notes, and snippets.

@yujikiriki
Created October 22, 2015 23:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yujikiriki/9d6d61554311d35f0d1b to your computer and use it in GitHub Desktop.
Save yujikiriki/9d6d61554311d35f0d1b to your computer and use it in GitHub Desktop.
Tuple of Options filter with shapeless
import shapeless.syntax.std.tuple._
val optionTuple = (Some(Event("Jeff", 1)), None, None, Some(Event("Son", 1)))
println(s"optionTuple = $optionTuple")
val out = optionTuple.filter[Some[Event]]
println(s"out = $out")
case class Event(a: String, b: Int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment