What is the difference between a strongly statically typed language and a weakly statically typed language?
What is the defining characteristic of a dynamically typed language?
Suppose that function f is defined by
f(x, y) = (y, head(x))What is the most general polymorphic type of f? Use Greek letters for type variables.
Suppose that function f is defined by
f(x, y, z) = x :: y :: zWhat is the most general polymorphic type of f? Use Greek letters for type variables.
Suppose that function f is defined by
f x y = y xWhat is the most general polymorphic type of f? Use Greek letters for type variables. Notice that f is curried.
What is the value of each of the following Cinnameg expressions? (foldLtoR i f x) is a left-to-right fold with initial value i and function f on list x.
Function select is written so that (select p x) returns the first member m of list x such that p(m) is true. (For the purposes of this question, it will not matter what select does when there is no such m.) Notice that p is a predicate, a function that produces a boolean result. Predicate odd? returns true on an odd integer and false on an even integer. (The question mark is part of the name of function odd?.) For example, (select odd? [2,3,4,5,6]) = 3.
Given definition
f x y = (x+1)::y.
You are given the following function definition.
f x y z = y x (x::z)
What kind of thing is parameter z? (A number, a list, a function, or something else)? Answer
What kind of thing is parameter y? (A number, a list, a function, or something else)? Answer
What kind of thing does expression f(2) yield? (A number, a list, a function, or something else? Is this expression allowed?) Answer
By choosing among the operations foldLtoR, foldRtoL and map write a Cinnameg definition for each of the following that make direct use of recursion or loops.
Write a definition of a function called doubleAll that takes a list x of numbers as its parameter and produces a list of the doubles numbers in list x as its result. For example, doubleAll([5,2,19,3]) = [10,4,38,6].
Write a definition of a function called product so that product(x) yields the product of all of the members of list x, where x is a list of numbers. (Product means multiply.)