I am trying to write a function that returns the absolute value of an integer...
abs :: Int -> Int
abs n | n >= 0 = n
| otherwise = -n
myabs :: Int -> Int
myabs n = if n >= 0 then n else -n
They both work for positive integers but not negative integers. Any idea why?