Division in Haskell

Use div, which performs integer division: halfEvens :: [Int] -> [Int] halfEvens [] = [] halfEvens (x:xs) | odd x = halfEvens xs | otherwise = x `div` 2 : halfEvens xs The (/) function requires arguments whose type is in the class Fractional, and performs standard division. The div function requires arguments whose type … Read more