Skip to content

Instantly share code, notes, and snippets.

@wheaties
Created February 18, 2016 02:19
Show Gist options
  • Select an option

  • Save wheaties/eaad8ffe6b5d681d5529 to your computer and use it in GitHub Desktop.

Select an option

Save wheaties/eaad8ffe6b5d681d5529 to your computer and use it in GitHub Desktop.
trait OneOf[Obj, Items]
object OneOf extends LowPriorityOneOf{
implicit left[L, R] = new OneOf[L, L | R]{}
}
trait LowPriorityOneOf{
implicit right[L, R] = new OneOf[R, L | R]{}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment