Question: 1 ) Write a Haskell function using pattern matching that duplicates each element in the given list and concatenates them together twice. Only use Patterns,

1) Write a Haskell function using pattern matching that duplicates each element in the
given list and concatenates them together twice. Only use Patterns, built-in functions and
Guards are not allowed.
For example, for the function duplicateList,
duplicateList [6,3,7], the output should be [6,6,3,3,7,7]
2) Write a Haskell function using only Patterns and Guards that generates a list of all
integers between the two given numbers inclusively. No built-in functions are allowed.
For example, for the function listNumbers,
listNumbers 35---- the output should be [3,4,5]
listNumbers 63---- the output should be [6,5,4,3]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!