I'm receiving an error and don't know why.
mapo :: ((Float, Float) -> Float) -> [(Float, Float)] -> [Float]
mapo f [] = []
mapo f (x:y) = f x : mapo f y
Compiles ok.
*Main> mapo + [(1,2)]
Couldn't match type `(Float, Float) -> (Float, Float)' with `Float'
Expected type: (Float, Float) -> Float
Actual type: (Float, Float) -> (Float, Float) -> (Float, Float)
In the first argument of `mapo', namely `(+)'
In the expression: mapo (+) [(1, 2)]
In an equation for `it': it = mapo (+) [(1, 2)]
The purpose of this function is to receive an operator (let's say + or -), a list of pairs of numbers (Float) and return the result of using that operator with each of the pairs of parameters of the list.