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

Patai Gergely patai_gergely at fastmail.fm
Thu Dec 31 03:24:06 EST 2009


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



More information about the Haskell-Cafe mailing list