Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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: (:,, ) 7.runLengthDecode:: [(Int, Char)] -> String Write a function that takes the output of runLengthEncode and returns the original string. Examples runLengthDecode [(1,'h'), (5,'i')] >runLengthDecode $ runLengthEncode "whhhhaaaaat?" Permitted functions: (++),(),replicate 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: (:,, ) 7.runLengthDecode:: [(Int, Char)] -> String Write a function that takes the output of runLengthEncode and returns the original string. Examples runLengthDecode [(1,'h'), (5,'i')] >runLengthDecode $ runLengthEncode "whhhhaaaaat?" Permitted functions: (++),(),replicate

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

How did eBay pursue international growth?

Answered: 1 week ago

Question

Describe four issues that affect career management

Answered: 1 week ago

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago

Question

What is quality of work life ?

Answered: 1 week ago