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?

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!