hi,
I am trying to implement a set multiplication program in haskell.
Input : [1,2,3] [4,5] [6,7]
Ouput : [ [1,4,6] , [1,4,7] , [1,5,6] , [1,5,7] ...]
I implemented it for constant number of inputs like
setMul xs ys zs = [ [x] ++ [y] ++ [z] | x <- xs , y<-ys ,z <- zs]
I am not able to generalize this for any number of lists.
type signature would be :
setMulMany :: [[a]] -> [[a]]
Example :
Input : [ [1,2,3] , [4,5] , [6,7]]
Ouput : [ [1,4,6] , [1,4,7] , [1,5,6] , [1,5,7] ...]
Regards.
Nishant