[Haskell-cafe] Is this haskelly enough? -- errm but every answer is wrong(?)

J. Garrett Morris trevion at gmail.com
Tue Jul 17 23:02:10 EDT 2007


On 7/17/07, Anthony Clayden <anthony_clayden at clear.net.nz> wrote:
> 2. The inits . tails approach adds a fault:
>    It introduces a sprinkling of empty sub-sequences. These
> have sum zero.
>    So in case the input list is all negative numbers ...

At least the concatMap inits . tails code that I posted also filtered
empty lists to avoid this problem... it seems like a simple omission
rather than a fault in the approach.

 /g

-- 
The man who'd introduced them didn't much like either of them, though
he acted as if he did, anxious as he was to preserve good relations at
all times. One never knew, after all, now did one now did one now did
one.


More information about the Haskell-Cafe mailing list