Successfully reported this slideshow.
Your SlideShare is downloading. ×

Haskell Task Description- Complete the following coding requirements-.docx

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 1 Ad

Haskell Task Description- Complete the following coding requirements-.docx

Download to read offline

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)
.

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)
.

Advertisement
Advertisement

More Related Content

More from rtodd588 (20)

Recently uploaded (20)

Advertisement

Haskell Task Description- Complete the following coding requirements-.docx

  1. 1. 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)

×