This is my function:
bestLocByArtiest :: String -> [Review] -> Double
bestLocByArtiest art = rev
where gmloc = [gemZaalByArtiest art, gemFestByArtiest art, gemOpenByArtiest art]
rev = max gmloc
This is the error i get:
Review.hs:101:24:
Couldn't match type `[Review] -> Double' with `Review'
Expected type: [Review] -> Double
Actual type: [[Review] -> Double] -> [[Review] -> Double]
In the expression: rev
In an equation for `bestLocByArtiest':
bestLocByArtiest art
= rev
where
gmloc = [gemZaalByArtiest art, ....]
rev = max gmloc
So I was hoping somebody could explain me what this error means and what I have to change in my code to solve it.
EDIT By changing max to maximum i got this new error:
Review.hs:103:21:
No instance for (Ord ([Review] -> Double))
arising from a use of `maximum'
Possible fix:
add an instance declaration for (Ord ([Review] -> Double))
In the expression: maximum gmloc
In an equation for `rev': rev = maximum gmloc
In an equation for `bestLocByArtiest':
bestLocByArtiest art
= rev
where
gmloc = [gemZaalByArtiest art, ....]
rev = maximum gmloc
What does this mean?
maxdoes maximum of two, not of a list of N elements. You wantmaximum. Also, you don't seem to be accepting your second argument (the[Review]).