This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: doubly zipped

No replies
Kevin Wright
Joined: 2009-06-09,
User offline. Last seen 49 weeks 3 days ago.
I knew it had to be something obvious :)
Thanks everyone, cookies all round!


On 25 May 2010 22:45, Paul Phillips <paulp@improving.org> wrote:
On Tue, May 25, 2010 at 10:35:05PM +0100, Kevin Wright wrote:
> So... what am I missing?

scala> grid zip result map { case (a, b) => a zip b }
res1: List[List[(Int, Int)]] = List(List((1,1), (0,2), (1,1)), List((0,3), (0,4), (0,2)), List((1,2), (1,2), (0,1)))

scala> (grid, result).zipped map (_ zip _)
res2: List[List[(Int, Int)]] = List(List((1,1), (0,2), (1,1)), List((0,3), (0,4), (0,2)), List((1,2), (1,2), (0,1)))

--
Paul Phillips      | All men are frauds.  The only difference between
Analgesic          | them is that some admit it.  I myself deny it.
Empiricist         |     -- H. L. Mencken
up hill, pi pals!  |----------* http://www.improving.org/paulp/ *----------



--
Kevin Wright

mail/google talk: kev.lee.wright@googlemail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland