Hello I am learning Haskell at the moment and I was wondering if and how I can pass a function of Eq as a parameter to another function since it works with (+), (-) and (*) (and I know passing functions in general works in haskell). I want to work with the Eq operator in my bar function depending on if the head of my list is smaller, equal or bigger than 0. But the way I did it in my code snippet below I get a compiler error. Sorry if I am missing something obvious here I am pretty new to haskell, your help and explanations are appreciated.
foo :: [x] -> [x]
foo x
| head x < 0 = bar (<) x
| head x == 0 = bar (==) x
| head x > 0 = bar (>) x
bar :: (a -> a -> Bool) -> [x] -> [x]
bar func x = ...