maxBy :: (a -> Int) -> a -> a -> a maxBy measure a b = max $ (measure a) (measure b) • Couldn't match expected type ‘Int -> a0’ with actual type ‘Int’ • The function ‘measure’ is applied to two arguments, but its type ‘a -> Int’ has only one In the second argument of ‘($)’, namely ‘(measure a) (measure b)’ In the expression: max $ (measure a) (measure b) | 31 | maxBy measure a b = max $ (measure a) (measure b) | ^^^^^^^^^^^^^^^^^^^^^^^