I'm trying to run this textbook example but I keep getting this error:
* Couldn't match expected type `Integer -> t'
with actual type `[Char]'
* The function `showPerson' is applied to two arguments,
but its type `People -> [Char]' has only one
In the expression: showPerson "charles" 18
In an equation for `it': it = showPerson "charles" 18
* Relevant bindings include it :: t (bound at <interactive>:38:1)
I don't understand why I'm getting this error. I'm inputting the correct types.
My code is:
type Name = String
type Age = Int
data People = Person Name Age
showPerson :: People -> String
showPerson (Person a b) = a ++ " -- " ++ show b