I'm new to Haskell and I need to define this data type:
data Restaurant = Restaurant [(String, String, Int)] deriving (Eq,Show)
that is a list of the employees of the restaurant: (name , address, wage) for each employee.
Now, I'm trying to define this numberOfEmployees function:
numberOfEmployees :: Restaurant -> Int
numberOfEmployees rest = length rest
But I get this compile error: Couldn't match expected type ‘t2 a0’ with actual type ‘Restaurant'
Why is it working if I use type instead of data? (I can't use the 'type' declaration in my code because it's part of an exercise about 'data')
type Restaurant = [(String, String, Int)]