On Tue, Jul 23, 2013 at 3:53 PM, Costello, Roger L. <costello@mitre.org> wrote:
Also, how would I modify this:

        [(a,b) | a <- f xs, b <- g xs]

so that it produces this:

        [("a",[])]

Try:  [(a,b) | a <- f xs | b <- g xs]

Note the 2nd parallel bar. You may have to enable a Parallel List Comprehension pragma or somesuch.

Everyone else has given great explanations about your curious definitions of f and g and why the original does what it does. Well worth looking into.

-- Kim-Ee