SlideShare une entreprise Scribd logo
1  sur  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)

Contenu connexe

Plus de rtodd588

Graphite bonds in flat sheets with only London forces to hold the shee.docx
Graphite bonds in flat sheets with only London forces to hold the shee.docxGraphite bonds in flat sheets with only London forces to hold the shee.docx
Graphite bonds in flat sheets with only London forces to hold the shee.docxrtodd588
 
Given this information about activity 3-4- ES - 10- EF - 15- LS - 16-.docx
Given this information about activity 3-4- ES - 10- EF - 15- LS - 16-.docxGiven this information about activity 3-4- ES - 10- EF - 15- LS - 16-.docx
Given this information about activity 3-4- ES - 10- EF - 15- LS - 16-.docxrtodd588
 
Growing active lifestyle apparel segment Wholesale distribution mix De.docx
Growing active lifestyle apparel segment Wholesale distribution mix De.docxGrowing active lifestyle apparel segment Wholesale distribution mix De.docx
Growing active lifestyle apparel segment Wholesale distribution mix De.docxrtodd588
 
Group Policy is one of the most useful features of Windows Server 2008.docx
Group Policy is one of the most useful features of Windows Server 2008.docxGroup Policy is one of the most useful features of Windows Server 2008.docx
Group Policy is one of the most useful features of Windows Server 2008.docxrtodd588
 
how can I better understand how to do the reverse in factoring polynom.docx
how can I better understand how to do the reverse in factoring polynom.docxhow can I better understand how to do the reverse in factoring polynom.docx
how can I better understand how to do the reverse in factoring polynom.docxrtodd588
 
Holly inherited $10-000 of City of Atlanta bonds in February- In March.docx
Holly inherited $10-000 of City of Atlanta bonds in February- In March.docxHolly inherited $10-000 of City of Atlanta bonds in February- In March.docx
Holly inherited $10-000 of City of Atlanta bonds in February- In March.docxrtodd588
 
Hi- Please- need help- and step by step- More detail- I need to unders.docx
Hi- Please- need help- and step by step- More detail- I need to unders.docxHi- Please- need help- and step by step- More detail- I need to unders.docx
Hi- Please- need help- and step by step- More detail- I need to unders.docxrtodd588
 
hich is most solo ble ethane - ethamol2 butane ar butanal2 SolutionAlk.docx
hich is most solo ble ethane - ethamol2 butane ar butanal2 SolutionAlk.docxhich is most solo ble ethane - ethamol2 butane ar butanal2 SolutionAlk.docx
hich is most solo ble ethane - ethamol2 butane ar butanal2 SolutionAlk.docxrtodd588
 

Plus de rtodd588 (8)

Graphite bonds in flat sheets with only London forces to hold the shee.docx
Graphite bonds in flat sheets with only London forces to hold the shee.docxGraphite bonds in flat sheets with only London forces to hold the shee.docx
Graphite bonds in flat sheets with only London forces to hold the shee.docx
 
Given this information about activity 3-4- ES - 10- EF - 15- LS - 16-.docx
Given this information about activity 3-4- ES - 10- EF - 15- LS - 16-.docxGiven this information about activity 3-4- ES - 10- EF - 15- LS - 16-.docx
Given this information about activity 3-4- ES - 10- EF - 15- LS - 16-.docx
 
Growing active lifestyle apparel segment Wholesale distribution mix De.docx
Growing active lifestyle apparel segment Wholesale distribution mix De.docxGrowing active lifestyle apparel segment Wholesale distribution mix De.docx
Growing active lifestyle apparel segment Wholesale distribution mix De.docx
 
Group Policy is one of the most useful features of Windows Server 2008.docx
Group Policy is one of the most useful features of Windows Server 2008.docxGroup Policy is one of the most useful features of Windows Server 2008.docx
Group Policy is one of the most useful features of Windows Server 2008.docx
 
how can I better understand how to do the reverse in factoring polynom.docx
how can I better understand how to do the reverse in factoring polynom.docxhow can I better understand how to do the reverse in factoring polynom.docx
how can I better understand how to do the reverse in factoring polynom.docx
 
Holly inherited $10-000 of City of Atlanta bonds in February- In March.docx
Holly inherited $10-000 of City of Atlanta bonds in February- In March.docxHolly inherited $10-000 of City of Atlanta bonds in February- In March.docx
Holly inherited $10-000 of City of Atlanta bonds in February- In March.docx
 
Hi- Please- need help- and step by step- More detail- I need to unders.docx
Hi- Please- need help- and step by step- More detail- I need to unders.docxHi- Please- need help- and step by step- More detail- I need to unders.docx
Hi- Please- need help- and step by step- More detail- I need to unders.docx
 
hich is most solo ble ethane - ethamol2 butane ar butanal2 SolutionAlk.docx
hich is most solo ble ethane - ethamol2 butane ar butanal2 SolutionAlk.docxhich is most solo ble ethane - ethamol2 butane ar butanal2 SolutionAlk.docx
hich is most solo ble ethane - ethamol2 butane ar butanal2 SolutionAlk.docx
 

Dernier

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 

Dernier (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

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

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