Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write this in ML Write a function named of type that takes a 2-tuple as an argument and returns a list of the 2 integers

write this in ML image text in transcribed
Write a function named of type that takes a 2-tuple as an argument and returns a list of the 2 integers in sorted order, smallest first. Write a function named of type whose output list is the same as the input list, but with the first element of the list moved to the end. For example, should return (Hint: Use@) Write a function named that removes the second element from a list. In other words, when given a list , the function should evaluate to Note: the "Warning: match nonexhaustive" error is acceptable for this function, since we have not yet learned how to correct for this. (See hit below). Write a function named of type that takes a 3-tuple as an argument and returns a list of the 3 integers in sorted order, smallest first. (Hint: use carefully indented, carefully commented, nested if statements) Think of the cons operator as either: - Removing an element from the list (when used in the argument for a function) - Adding an element to the front of the list (when used in the function body) Try experimenting with using the cons operator more than one time in the argument of the function

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

More Books

Students also viewed these Databases questions