I have two functions. The first one gives true if all elements of the list are zero
allZero :: [Int] -> Bool
allZero [] = False
allZero [0] = True
allZero (x:xs)
| x == 0 && allZero xs = True
|otherwise = False
The second function gives true if at least one element of the list is zero
oneZero :: [Int] -> Bool
oneZero [] = False
oneZero (x:xs)
| x == 0 = True
| otherwise = oneZero xs
Maybe there is another way to solve this problems. For example with map or foldr? Thank you
question from:https://stackoverflow.com/questions/65645698/implement-the-functions-using-map-and-foldr-haskell