- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: doubly zipped
Tue, 2010-05-25, 22:54
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:
--
Kevin Wright
mail/google talk: kev.lee.wright@googlemail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
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