Question: Haskell 5.unzip' :: [(a,b)]- (a], [b]) Write a function that takes a list of two-tuples and returns a tuple of two lists-the first containing the
Haskell
![Haskell 5.unzip' :: [(a,b)]- (a], [b]) Write a function that takes a](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f1685840678_92066f1685822102.jpg)
5.unzip' :: [(a,b)]- (a], [b]) Write a function that takes a list of two-tuples and returns a tuple of two lists-the first containing the first element of each tuple, and the second the second element (the reverse of "zip") Examples: ('a',1) , ('b' ,5) , ( 'c',) , unzip' (" ("abc", [1,5,8]) Permitted functions:() 6. runLengthEncode : String [(Int,Char) Run-length encoding is a simple form of data compression that replaces characters in a stream with the count of adjacent occurrences of that character and just a single instance of the character itself. Write a function that takes a string and returns a list of tuples reprenting the run-length encoding of that string. Examples: runLengthEncode "aaaaaaabbb'" runLengthEncode "happy daaay" Permitted functions: (:,, ) 5.unzip' :: [(a,b)]- (a], [b]) Write a function that takes a list of two-tuples and returns a tuple of two lists-the first containing the first element of each tuple, and the second the second element (the reverse of "zip") Examples: ('a',1) , ('b' ,5) , ( 'c',) , unzip' (" ("abc", [1,5,8]) Permitted functions:() 6. runLengthEncode : String [(Int,Char) Run-length encoding is a simple form of data compression that replaces characters in a stream with the count of adjacent occurrences of that character and just a single instance of the character itself. Write a function that takes a string and returns a list of tuples reprenting the run-length encoding of that string. Examples: runLengthEncode "aaaaaaabbb'" runLengthEncode "happy daaay" Permitted functions: (:,, )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
