Get sum of int or integer in Haskell

Viewed 1912

This function should work for both lists of Int and lists of Integer:

myFunc :: [Integer] -> [Char]
myFunc x =  if (sum x `mod` 2 ==1) then "odd" else "even"

But it only works on lists of Integers.

2 Answers
Related