I have a list of tuples which i need to return a [Int] which are all the locations are dividable by 2 ..
type A = [(Int, Int, Int, Int)]
func :: A -> [Int]
func tuples = [a | (a, b, c, d) <- tuples, map a `mod` 2 == 0]
func [(244,244,244,244),(244,244,244,244),(244,244,244,244)]
Output
[244,244,244]
I have the current code but problem is this only checking position of a .. but i required to all a ,b , c,d ?
The
allfunction returns true only if everything given satisfies the predicate. I’ve bundled the tuple into a list and checked the predicate.