Haskell
Task Description: Complete the following coding requirements.
Complete these activities from the “Haskell – Day 1†self-study.
1-Write a function that takes a list and returns the same list in reverse.
2-Test the reverse list function using a number of lists with different data types and lengths.
Complete these activities from the “Haskell – Day 2†self-study.
3-Write a sort that takes a list and returns a sorted list.
4-Test the sort function using a variety of lists with different lengths.
Solution
I know there\'s a built-in function that does it for me but the requirement is that I only use head , tail , elem and null (No pattern matching either). So my question is: is there a better solution where I only have one function, myreverse, that consumes only one list? (That meets the requirements above, of course)
.