Please help me

Ashley Yakeley ashley@semantic.org
Thu, 8 Feb 2001 02:04:45 -0800


At 2001-02-08 13:49, FAIZAN RAZA wrote:

>write a Haskell
>function cartesianProduct which when given three lists  (to represent three
>sets) of integers returns a list of lists of ordered triples.

That's easy. Just define 'product' as a function that finds the cartesian 
product of any number of lists, and then once you've done that you can 
apply it to make the special case of three items like this:

cartesianProduct a b c = product [a,b,c]

At least, that's how I would do it.

-- 
Ashley Yakeley, Seattle WA