I’m assuming this is a homework question, so I don’t think it will help you much to give away the whole answer. I think you should be more clear about what parts of the question you are struggling with. Without that information it is very hard for us to help you.
One thing you can try is to solve a simpler problem. For example:
Write a function called “unary” which receives a natural number ‘n’ and returns a unary string of length n, for example:
Maybe one could be devised for a Haskell obfuscator which converts simple expressions into hideous monstrosities, complete with space-leaks, the odd call of a partial definition, etc…perfect for “homework answers”.
Have you noticed the following trend and it suggests a recursive strategy?
binary 3
= ["000","001","010","011","100","101","110","111"]
= ["000","001","010","011"] ++ ["100","101","110","111"]
= (make ["00","01","10","11"] then add 0 to everyone) ++ (make ["00","01","10","11"] then add 1 to everyone)
= (binary 2 then add 0 to everyone) ++ (binary 2 then add 1 to everyone)