Question: WRITE IT IN HASKELL Using the addition function over the natural numbers, give a recursive definition of multiplication of natural numbers. Question The integer square

WRITE IT IN HASKELL
Using the addition function over the natural numbers, give a recursive definition of multiplication of natural
numbers.
Question The integer square root of a positive integer n is the largest integer whose square is less than or
equal to n . For instance, the integer square roots of 15 and 16 are 3 and 4, respectively. Given a primitive
recursive definition of this function.
Question Give a recursive definition of a function to find the highest common factor of two positive
integers.
Question Give a definition of the function below
orderTriple : : (Integer, Integer, Integer)->(Integer, Integer, Integer)
which puts the elements of a triple of three integers into ascending order.
Question Define a function to give the length of the perimeter of a geometrical shape, of type Shape. What
is the type of this function?
Question Add an extra constructor to Shape for triangles, and extend the functions isRound, area and
perimeter to include triangles.
Question Give a definition of a function below, which triples all the elements of a list of integers.
tripleAll : : [Integer][Integer]
Question Give a definition of a function which converts all small letters in a String into capitals, leaving the
other characters unchanged.
capitalize : : String String
Question Define the function below, which returns the list of divisors of a positive integer (and the empty
list for other inputs). For instance, divisors 12=[1,2,3,4,6,12]
divisor : : Integer [Integer]
Question A prime number n is a number whose only divisors are 1 and n. Using divisors or otherwise define
a function which checks whether or not a positive integer is prime (and returns False if its input is not a
positive integer).
WRITE IT IN HASKELL Using the addition function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!