Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions