Question: This problem is supposed to be coded in Standard ML, I tried this fun exists (x, L) = if null L then false else if

 This problem is supposed to be coded in Standard ML, I

This problem is supposed to be coded in Standard ML, I tried this

fun exists (x, L) = if null L then false else if x = hd(L) then true else exists(x, tl(L));

but I get this error 'stdIn:27.52 Warning: calling polyEqual'.

1. exists -15% This function should return true if the first argument is a member of the second argument and have type (''a''a list) ->bool. Explain in a comment why the typeis (''a''a list) ->bool and not ('a'a list) bool Note: this function is not required to be tail-recursive. Examples exists (1,1) false > exists (1,(1,2,31) true exists ((1],1]1) true > exists ((1), [[3),[5]]); false exists "c","b","c","z"]): true

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!