I am trying to solve an exercises that Convert Fahrenheit to Celsius and vice versa but I'm getting this warning:
Pattern match is redundant
In an equation for ‘tempToC’: tempToC temp = ...compile(-Woverlapping-patterns)
I am new to Haskell and need help understanding the cause of the warning.
module Temperature (tempToC, tempToF) where
{- Implement the function `tempToC` to convert
` Fahrenheit to Celsius -}
tempToC :: Integer -> Float
tempToC temp = error "Implement this function."
tempToC temp = fromIntegral (temp - 32 ) / 1.8 --line of the warning
{- Implement the function `tempToF` to convert
Celsius to Fahrenheit -}
tempToF :: Float -> Integer
tempToF temp = error "Implement this function."
tempToF temp = ceiling (temp * 1.8 + 32) --line of the warning