Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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?

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 F# Interactive Tool to find out!

let testA = 2 let testB x = 2 + x let testC x = 2.0 + x let testD = "hello" let testE = printfn "hello" let testF () = 42 let testG () = printfn "hello" let testH x = String.length x let testI x = sprintf "%i" x let testJ x = printfn "%i" x let testK x = printfn "x is %f" x; x // return x let testL (f:int -> string) x = f x let testM f (x:int) :string = f x let testN x :string = x 1 // hint: what does :string modify? let testO x = 1 let testP x = x 1 // hint: what kind of thing is x? let testQ x y = x let testR x y z = z let testS x = x=x let testT f = (f 1) + 2 let testU f = sprintf "%i" (f 1) let testV f = f() + 2 let testW x = fun y -> y * x let testX x y = y * x let testY = fun x y -> y * x let testZ f x = (f 1) + x

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

What is the advantage of making a Section 83(b) election?

Answered: 1 week ago