Question: write haskell code for the following Exercise 5. Types of expressions __2*4+3*5=23 points Assume f has the type (Int -> Bool) -> Int -> Bool,
Exercise 5. Types of expressions __2*4+3*5=23 points Assume f has the type (Int -> Bool) -> Int -> Bool, determine the type of each expres- sion below. Note, the expression may contain type errors. Give the details of your reasoning. For example, give the parameter type and return type of the function and the type of the argument, Also, if instantiation is required, please specify how type variables are instantiated. (a) f succ (b) f ( -> b) -> -> [a] => band "abc" has the type (Char). (i) foldr (++) "abc" Exercise 5. Types of expressions __2*4+3*5=23 points Assume f has the type (Int -> Bool) -> Int -> Bool, determine the type of each expres- sion below. Note, the expression may contain type errors. Give the details of your reasoning. For example, give the parameter type and return type of the function and the type of the argument, Also, if instantiation is required, please specify how type variables are instantiated. (a) f succ (b) f ( -> b) -> -> [a] => band "abc" has the type (Char). (i) foldr (++) "abc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
