Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

can someone help me answer the following #Fsharp multiple choice questions along

ID: 3880536 • Letter: C

Question

can someone help me answer the following #Fsharp multiple choice questions along with explanations for each question please.

1. What type does F# infer for the expression fun x y -> x+y+"." ? Select one:

A. string -> string -> string

B.string * string -> string

C. Type error.

D. int -> int -> string

2. What type does F# infer for the expression fun xs -> List.map (+) xs ? Select one:

A. int list -> int -> int list

B. int list -> int list

C. Type error.

D. int list -> (int -> int) list

3. Which of the following does F# infer to have type string -> string -> string ? Select one:

A. fun x -> fun y -> x y "."

B. fun x y -> String.length x * String.length y

C. fun (x, y) -> x + y + "."

D. (+)

4. Which of the following does F# infer to have type (string -> string) -> string ? Select one:

A. fun f -> String.length (f "cat")

B. fun x y -> x + " " + y

C. fun f -> f (f "cat")

D. fun f -> f "cat"

Explanation / Answer

1. What type does F# infer for the expression fun x y -> x+y+"." ?

Option:D

Answer:int -> int -> string

Explonation: Chained arrow notation

2. What type does F# infer for the expression fun xs -> List.map (+) xs ?

Option:A

Answer:int list -> int -> int list

Explonation:(+) indicates for Int

3)Which of the following does F# infer to have type string -> string -> string ? Select one:?

Option:B

Answer: fun x y -> String.length x * String.length y

Explonation remaing all are int functions

4. Which of the following does F# infer to have type (string -> string) -> string ? Select one:?

Option:C

Answer:fun f -> f (f "cat")

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote