[SOLVED] function called tupleDistance, zip3Lists, everyOther

20.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

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.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.