Question: L o up study and med. PaperCut Login for Getting toyd Q1. For each of the following definitions say whether it is a simple value
L o up study and med. PaperCut Login for Getting toyd Q1. 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? If in doubt, run them in the interactive Tool to find out let testa-2 let test - 2 + x lettestCX-2.0 + x let test - "hello let teste printin "hello let testo - 42 lettest 0 -printin "hello let testHxString length x Let testi x-sprint Wix let test x-printinx let testkx printin xis xxl return x let testi (int > string fx let testM fcint) string-fx letteste x string - X1 // hint what does string modify? let testox-1 letteste x-x+ // hint what kind of thing is X? let testQxy-X let testRxyz let tests xxx let testi-(1) - 2 let testUf-sprintf (f1) let testy-102 let testWxfun yy*X let testxxyyx lettesty - fun xy > y*x let testz fx-(f1) + Submit type signatures for the every expression. 92. For each of the following signatures, create a function that will be inferred to have that signature word using explicit type annotations! val -intint valintunit vals -int-> string valsig - unit string valsig - string> string val i nt > bool > float -> string val si i ntyaint>int N 2 different implementation styles, please valpH = int (int-int) Al Hint define a nested function walifunint)int val -cinty intintint valsk-fint -> int (int in valsiel-infiint-intint val SM-tint intint val N- t ra-int) L o up study and med. PaperCut Login for Getting toyd Q1. 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? If in doubt, run them in the interactive Tool to find out let testa-2 let test - 2 + x lettestCX-2.0 + x let test - "hello let teste printin "hello let testo - 42 lettest 0 -printin "hello let testHxString length x Let testi x-sprint Wix let test x-printinx let testkx printin xis xxl return x let testi (int > string fx let testM fcint) string-fx letteste x string - X1 // hint what does string modify? let testox-1 letteste x-x+ // hint what kind of thing is X? let testQxy-X let testRxyz let tests xxx let testi-(1) - 2 let testUf-sprintf (f1) let testy-102 let testWxfun yy*X let testxxyyx lettesty - fun xy > y*x let testz fx-(f1) + Submit type signatures for the every expression. 92. For each of the following signatures, create a function that will be inferred to have that signature word using explicit type annotations! val -intint valintunit vals -int-> string valsig - unit string valsig - string> string val i nt > bool > float -> string val si i ntyaint>int N 2 different implementation styles, please valpH = int (int-int) Al Hint define a nested function walifunint)int val -cinty intintint valsk-fint -> int (int in valsiel-infiint-intint val SM-tint intint val N- t ra-int)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
