Scalaã«ã¯ä¸ç½®ãã¿ã¼ã³ï¼infix patternï¼ã¨å¼ã°ããæ©è½ãããã¾ããããã¯åç´ã«ããã¨ã case class ~[A, B](a: A, b: B) ã®ããã«ãã¦å®ç¾©ããã±ã¼ã¹ã¯ã©ã¹ã«å¯¾ãã¦*1ã scala> val ab = new ~(1, "FOO") ab: ~[Int,String] = ~(1,FOO) scala> val a ~ b = ab a: Int = 1 b: String = FOO ãã®ããã«ãã¿ã¼ã³åãä¸ç½®ï¼infixï¼ã«ãã¦æ¸ããã¨ãã§ããæ©è½ã§ãããã®æ©è½ãä¸è¦ä½¿ãéãå°ãªããã§ãããå®ã¯çãããæ¥é ãããã使ããã¦ãã¾ãã ã¾ãã list match { case x::y::xs => ... } ã®ããã«ããªã¹ãã::ã使ã£ããã¿ã¼ã³ãããã§å解ãããã¨ã¯ããããã¨æãã¾ãããããã¯ã::ã¨ããä¸ç½®ãã¿ã¼ã³ãããã°ããã§ããæ¸ã
{{#tags}}- {{label}}
{{/tags}}