Question: NOTE: Function should be implemented in Haskell! Run-length encoding, or RLE, is a common form of compression for data that are repetitious. Write a function,

 NOTE: Function should be implemented in Haskell! Run-length encoding, or RLE,

NOTE: Function should be implemented in Haskell!

Run-length encoding, or RLE, is a common form of compression for data that are repetitious. Write a function, myRLE, which takes as an input a list, and compresses it as follows: Main> myRLE [1, 1, 1, 2, 3, 1, 4, 4, 5, 5, 5, 1, 2] [(3, 1), (1, 2), (1, 3), (1, 1), (2, 4), (3, 5), (1, 1), (1, 2)] Main> myRLE "hhhelllllllo worrrrld" [(3, 'h'), (1, 'e'), (7, '1'), (1, 'o'), (1, ' '), (1, 'w'), (1, 'o'), (4, 'r'), (1, '1'), (1, 'd')] You might find it useful to define a helper function

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!