At 4:25 PM +1200 6/17/09, Richard O'Keefe wrote:
On 17 Jun 2009, at 2:01 pm, Richard O'Keefe wrote:
On second thoughts,

  let strings = "" : [pref++[last] | pref <- strings, last <- ['a'..'z']]
  in tail strings

seems more Haskellish than the stupidly clever counting-based
code I had in mind.  With this it's much easier to see what it's up to.

And here's a version along similar lines that avoids (++) for greater sharing and efficiency:

let sss = [""] : [ [ c:s | c <- ['a'..'z'], s <- ss ] | ss <- sss ] in concat (tail sss)
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to