Question: Consider the following function in ML. What is its inferred type? fun fib (iszero, isone, dec, add, n) if iszero(n) then n else if isone(n)

 Consider the following function in ML. What is its inferred type?

Consider the following function in ML. What is its inferred type? fun fib (iszero, isone, dec, add, n) if iszero(n) then n else if isone(n) then n else add( fib(iszero, isone, dec, add, dec(n) fib(iszero, isone, dec, add, dec(dec(n))) ('bool) (a-> bool (-> 'aaa -> 'a)'a 'a O (int->bool) (int-bool (int -int) (int int->int) int- int none of the above

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!