Question: Problem 4: Using pattern matching, write three functions, one for each of the following properties. Your functions should return true if the input list has
Problem 4:
Using pattern matching, write three functions, one for each of the following properties. Your functions should return true if the input list has the property and false otherwise.
- the lists first element is "bigred"
- the list has exactly two or four elements; do not use the length function
- the first two elements of the list are equal
Problem 5:
Write a function print_int_list : int list -> unit that prints its input list, one number per line. For example, print_int_list [1; 2; 3] should result in this output:
1
2
3
please use Ocaml for the coding
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
