Question: The following program does not type check. Which explanation is correct? f :: Ord a => (a -> a) -> (a -> a) -> Bool
The following program does not type check. Which explanation is correct? f :: Ord a => (a -> a) -> (a -> a) -> Bool f g h = g == h Functions cannot be compared for equality in Haskell. You cannot compare values of type a for equality. You cannot compare values of type a for equality when they are a member of Ord. Testing for equality is impossible without knowing the precise type. The type class Eq is not a subclass of the type class Ord
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
