Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete this exercise using the Haskell coding language In src/MP2a.hs you will find the declarations for ten function that you need to implement, each prefaced

Complete this exercise using the Haskell coding language

image text in transcribed

In "src/MP2a.hs" you will find the declarations for ten function that you need to implement, each prefaced by a comment containing a specification and sample calls/results. Because the goal here is to practice writing list-processing functions from scratch, you are to avoid using any list processing and higher-order functions defined by the Haskell standard library. List comprehensions are technically legal, but avoid them too if you can (just for now!). You may, however, use arithmetic and character processing functions. The functions you will implement are listed below, for reference: 1. cycleN :: Int [a][a] 2. chunksof :: Int [a][[a]] 3. unzip4 :: [(a,b,c,d)]([a],[b],[c],[d]) 4. intersperse :: a [[a]][a] 5. removeAll :: ( Eq a )[a][a][a] 6. sublist : (Int, Int) [a]([a],[a]) 7. luhn :: [Int] Bool 8. runLengthEncode :: String [( Int, Char )] 9. runLengthDecode :: [( Int, Char )] String

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions

Question

=+5 How does HRM relate to efforts to increase innovation?

Answered: 1 week ago