On Wed, 15 Oct 2003 17:07:00 +0100
Graham Klyne <[EMAIL PROTECTED]> wrote:

> [[
> lp []       = [[]]
> lp (as:ass) = concatMap (\a -> (map (a:) (lp ass))) as
> ]]
> 
> I think I should also be able to eliminate the lambda-abstraction, but
> I can't see how.  I prefer the list comprehension, as I find that
> easier to read than the \-expression.

lp (as:ass) = concatMap (flip map (lp ass) . (:)) as
but better,
lp = sequence

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

Reply via email to