Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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"]): trueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started