[SOLVED] function called tupleDistance, zip3Lists, everyOther

20.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

docx file icon Answer-1-1.docx (12.2 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
4/5 - (1 vote)

Use Haskell write 3 functions, and specified the type of each functions
1. function called tupleDistance that takes two lists of numbers and finds the cartesian distance between them. We assume the list is just a very big n-dimensional coordinate. You can assume both lists will be the same size. Now find the distance between them by using the generalized distance formula: .
2. Β function called zip3Lists that takes three lists as arguments and creates a list with a triple from each list consecutively. For example, zip3Lists [1, 2, 3] [4, 5, 6] [‘a’, ‘b’, ‘c’] would produce [(1, 4, ‘a’), (2, 5, ‘b’), (3, 6, ‘c’)]
3. function called everyOther that takes a list and constructs a new list only consisting of every other element in it.

  • Answer-1-1.docx