Created
December 24, 2011 09:49
-
-
Save piotrga/1517022 to your computer and use it in GitHub Desktop.
:: type alias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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