Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1: Construct a list that has the integers 1 through 5 in it. Use the square bracket notation for lists. Construct the same list,
Problem 1:
- Construct a list that has the integers 1 through 5 in it. Use the square bracket notation for lists.
- Construct the same list, but do not use the square bracket notation. Instead use :: and [].
- Construct the same list again. This time, the following expression must appear in your answer: [2; 3; 4]. Use the @ operator, and do not use ::.
Problem 2:
Write a function that returns the product of all the elements in a list. The product of all the elements of an empty list is 1.
Problem 3:
Write a function that concatenates all the strings in a list. The concatenation of all the strings in an empty list is the empty string "".
Please use Ocaml for the coding
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started