Skip to content

Instantly share code, notes, and snippets.

@piotrga
Created December 24, 2011 09:49
Show Gist options
  • Save piotrga/1517022 to your computer and use it in GitHub Desktop.
Save piotrga/1517022 to your computer and use it in GitHub Desktop.
:: type alias
case class FunnyPair[A,B](a:A, b:B)
type ::[A,B] = FunnyPair[A, B]
def add(x: Int :: Int) = x.a + x.b
scala> case class FunnyPair[A,B](a:A, b:B)
defined class FunnyPair
scala> type ::[A,B] = FunnyPair[A, B]
defined type alias $colon$colon
scala> def add(x: Int :: Int) = x.a + x.b
add: (x: ::[Int,Int])Int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment