Question: Assume f has the type (Int Bool) Int Bool, g has the type Int Bool Int Bool, and h has the type Int (Bool Int)

 Assume f has the type (Int Bool) Int Bool, g has

Assume f has the type (Int Bool) Int Bool, g has the type Int Bool Int Bool, and h has the type Int (Bool Int) Bool. Determine the type of each expression below. Note, the expression may contain type errors. In that case, you can say that the expression is not well typed. Give the details of your reasoning. If instantiations are required, please specify how type variables are instantiated. For some expressions, each expression contains more than one function call. For example, in the expression (4) below, we have two function calls: the first calls succ with the argument 3, the second calls f with arguments (succ 3) and even. You need to determine the types of all the function calls. (1) f even (2) g even (3) h even (4) f(succ3) even (5) g (succ3) even (6) h (succ 3) even (7) f even (succ 3) (8) foldr (+) "abc" Note foldr has the type (abb)b[a]b,+ has the type Int Int Int. and "abc" has the tvpe [Char]

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!