[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Space Efficiency When Sorting a List of Many Lists

Subject: Re: [Haskell-cafe] Space Efficiency When Sorting a List of Many Lists
From: "Patai Gergely"
Date: Thu, 31 Dec 2009 09:24:06 +0100
Hi,

> explode [[[1,2],[3],[4,5,6]], [[1, 2], [14,15], [16]]] --> [[1,3,4], 
> [1,3,5],[1,3,6],[2,3,4],[2,3,5],[2,3,6],[1,14,16],[1,15,16],
> [2,14,16],[2,15,16]]
I don't think the following will solve your problem, but explode can be
rewritten with existing functions thanks to the list monad:

explode = concatMap sequence

Gergely

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>