{"published":"2009-05-26 00:00:01","url":"https://mametter.hatenablog.com/entry/20090526/p2","width":"100%","author_name":"ku-ma-me","version":"1.0","provider_url":"https://hatena.blog","image_url":null,"title":" zipWith \u304c\u6b32\u3057\u3044","categories":["Scala"],"provider_name":"Hatena Blog","height":"190","blog_title":"\u307e\u3081\u3081\u3082","author_url":"https://blog.hatena.ne.jp/ku-ma-me/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmametter.hatenablog.com%2Fentry%2F20090526%2Fp2\" title=\" zipWith \u304c\u6b32\u3057\u3044 - \u307e\u3081\u3081\u3082\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://mametter.hatenablog.com/","description":"zip \u3068 map \u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u308c\u3070\u307e\u3042\u3044\u3044\u304b\u306a\u3068\u601d\u3063\u305f\u3093\u3060\u3051\u3069\u3001 val xs = List(1, 2, 3) val ys = List(4, 5, 6) xs zip ys map { (x, y) => x + y } // error: wrong number of parameters; expected = 1\u3050\u3042\u3042\u30fc\u3002\u5f15\u6570\u3092 n \u500b\u53d7\u3051\u53d6\u308b\u95a2\u6570\u3068 n-tuple \u3092 1 \u3064\u53d7\u3051\u53d6\u308b\u95a2\u6570\u304c\u533a\u5225\u3055\u308c\u308b\u304b\u3089\u3053\u3093\u306a\u3053\u3068\u306b\u3002\u3053\u3046\u66f8\u304f\u3057\u304b\u306a\u3044\u306e\u304b\u3002 xs zip ys map { case (x, y) => x + y } xs zip ys map { p => p._1 + p\u2026","type":"rich"}