Question: those are easy questions about ocaml,please help. I will give you thumb up! *Type Inference- 2. Consider a function with polymorphic type : ' ->
*Type Inference- 2. Consider a function with polymorphic type : ' -> 'a -> 2.1. What is the type of f O ? 2.2. What is the type of fun x -> (f ) ? Briefly explain your reasoning. * 'b) -> (b-> 'a) -> 'a 3. Consider a function with polymorphic type : ('a 3.1. What is the type of f (o, true) ? 3.2. What is the type of fun x y -> f (x, y) ? Does it have the same type as f ? Briefly explain your reasoning. 4. Consider a function with polymorphic type : ('a -> ' -> 'b) -> 'b 4.1. What is the type of g (+)? 4.2. What is the type of fun -> (g g) x ? Briefly explain your reasoning. 5. Consider the following function. let f (x : int list) : bool list = match x with [] -> x hd :: tl -> true :: 11 Is it well typed? Briefly explain your reasoning
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
