Question: F# Functions slides: https:/bviewer jupyter.org/github/wildart/CSC1364/blob/master/F%23%20Programming 20-4-20Functions.pynb 01. For each of the following definitions, say whether it is a simple value or a function and if

F# Functions slides: https:/bviewer jupyter.org/github/wildart/CSC1364/blob/master/F%23%20Programming 20-4-20Functions.pynb 01. For each of the following definitions, say whether it is a simple value or a function and if a function, what is the function signature? fin doubt run them in the interactive Tool to find out let testA-2 let testBX-2 + x let test x - 2.0 + X let test - "hello" let teste printin "hello let test() = 42 let test () - printfn "hello" let testHx = String length x let testixsprintfix let test x-printinx let testkx-printin xis xx return x let testi fint -> string) x fx let testM f cint) string - fx let testNx:string-xt hint: what does string modify? let testo - 1 let testPX-X1 hint: what kind of thing is x? let testoxy let testRxyz-Z let tests x-X-X let testTff1) + 2 let testUf-sprintf f1) let testvf ) + 2 let test x-fun y-yox let testxxy-yox let testy - fun xy-y*x let test fx (f1) + x Submit type signatures for the every expression. Q2. For each of the following signatures, create a function that will be inferred to have that signature. Avoid using explicit type annotations! val SigA-int->int val sig - intunit val sigC = int> string valsig -unit-> string val sige = string -> string val sigF = int> bool-> float> string val sigG = int> yint -> int II 2 different implementation styles, please val sigH = xint-> (int->int) I Hint: define a nested function val sigi = f[int->int)->int valsig - cint-yoint> zint-> int val sigk=f(int->int) -> (int->int) val sigl = cint -> f[int->int) -> int val sigM - f[int->int->int) -> int val sigN-xint-> ('a -> int) Submit function definitions for the every type signature
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
