CS计算机代考程序代写 (* Part 1: Type inference *)

(* Part 1: Type inference *)

let f1 a b = a + b;;

let f2 a b = if a then b else a;;

let f3 a b c = if (a +. b) == 0.0 then “Hi” else c;;

(* Part 2: Type definition *)

let tf1 a = failwith “unimplemented”

let tf2 a b c = failwith “unimplemented”

let tf3 a b = failwith “unimplemented”

(* Part 3: Functions *)

let concat str1 str2 = failwith “unimplemented”;;

let add_to_float integer flt = failwith “unimplemented”;;

let rec fib n = failwith “unimplemented”;;

(* Part 4: Lists *)

let rec add_three lst = failwith “unimplemented”;;

let rec filter n lst = failwith “unimplemented”;;

let rec double lst = failwith “unimplemented”;;