Question: Haskell programing ( GHC 8.8.2 ) Define a function that has the following type:(Ord a, Show a) => a -> a -> String,meaning that it

Haskell programing ( GHC 8.8.2 )

Define a function that has the following type:(Ord a, Show a) => a -> a -> String,meaning that

it receives two inputs of any type where that type is a member of type class Ord and a member of type class show

it returns a string

-------

I already did like this:

func x y = if x == y then show x else show y

But I am not sure it right or not, because the instruction said "it receives two inputs of any type"

for my function, it accepts only interger

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!