Skip to content

Instantly share code, notes, and snippets.

@xevix
Created November 19, 2015 14:44
Show Gist options
  • Save xevix/183a47bda4597061d1ac to your computer and use it in GitHub Desktop.
Save xevix/183a47bda4597061d1ac to your computer and use it in GitHub Desktop.
trait ListContainer[A <: ListContainer[A]] {
this: List[A] =>
def takeOne = take(1)
}
class MyContainer extends ListContainer[MyContainer] {
this: List[MyContainer] =>
def takeTwo = takeOne :: takeOne :: Nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment