Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a recursive Haskell function: 3. Write a recursive Haskell function strings Int -> Char -> Char -> [String] such that strings n chl ch2

Write a recursive Haskell function:

image text in transcribed

3. Write a recursive Haskell function strings Int -> Char -> Char -> [String] such that strings n chl ch2 returns a list of n strings, as follows: The first string has length n, and each subsequent string contains one fewer character. . The first (and each subsequent odd-indexed string) contains only the character ch1, and each even-indexed string contains only the charac- ter ch2. If n is negative, the empty list is returned For example, the function has the following behavior: *Main> strings 5 ,a, ,#, ["aaaaa" ,"####" , "aaa" ,"##" ,'' a '' ] *Main> strings 6'S''U' 3. Write a recursive Haskell function strings Int -> Char -> Char -> [String] such that strings n chl ch2 returns a list of n strings, as follows: The first string has length n, and each subsequent string contains one fewer character. . The first (and each subsequent odd-indexed string) contains only the character ch1, and each even-indexed string contains only the charac- ter ch2. If n is negative, the empty list is returned For example, the function has the following behavior: *Main> strings 5 ,a, ,#, ["aaaaa" ,"####" , "aaa" ,"##" ,'' a '' ] *Main> strings 6'S''U

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

More Books

Students also viewed these Databases questions

Question

How are investments related to changes in OCI?

Answered: 1 week ago

Question

Enhance the basic quality of your voice.

Answered: 1 week ago

Question

Describe the features of and process used by a writing team.

Answered: 1 week ago