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, 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
Get step-by-step solutions from verified subject matter experts
