Andreas Fuertig writes: > fillArray ["a"] > should be something like this: > [[("a",True)],[("a",False)]]
A pretty generic solution using the "Bounded" and "Enum" type classes to calculate the list of all values for a given type would be: enumAll :: (Bounded a, Enum a) => [a] enumAll = [ minBound .. maxBound ] fillArray :: (Bounded b, Enum b) => [a] -> [(a,b)] fillArray xs = [ (x,y) | x <- xs, y <- enumAll ] In GHCi, you can use these functions like this: | *Main> enumAll :: [Bool] | [False,True] | | *Main> fillArray "abc" :: [(Char, Bool)] | [('a',False),('a',True),('b',False),('b',True),('c',False),('c',True)] Peter _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell