logo CodeStepByStep logo


Language/Type: ML
Author: Marty Stepp (on 2018/01/19)

Define a function named sum_two_pairs that accepts two pairs of integers as parameters and returns the sum of all values in both pairs.

For example, the call of sum_two_pairs((0, 1), (2, 3)) should return 6 (from 0 + 1 + 2 + 3).

Your function must have the following signature:

val sum_two_pairs = fn : (int * int, int * int) -> int
Type your ML solution code here:

This is a function exercise. Write a ML function as described. Do not write a complete program; just the function(s) above.

You must log in before you can solve this problem.

Log In

Need help?

If you do not understand how to solve an exercise or why your solution doesn't work, please contact your TA or instructor.

If something seems wrong with the site (errors, slow performance, incorrect tests, etc.), please

Is there a problem? Contact a site administrator.

©, all rights reserved.