In Haskell the list notation:
[a,b,c]
Is just syntactic sugar for:
a:b:c:[]
And the string notation:
"abc"
Is just syntactic sugar for:
['a','b','c']
This means that the string:
"abc"
Is the same as:
'a':'b':'c':[]
Task
Given a string you should output what the de-syntaxed version would look like in Haskell.
Rules
You will receive a string by any valid input method, you should output a string ending with
:[]
with every character from the input surrounded by'
and separated by:
. The empty string should output[]
.You can assume that you will not receive any characters that require escaping (e.g.
'
, newlines, tabs ...) and that input will be in the printable ascii rangeThis is code-golf you should aim to minimize the byte count of your answer
Test Cases
"" -> []
"a" -> 'a':[]
"Hello, World" -> 'H':'e':'l':'l':'o':',':' ':'W':'o':'r':'l':'d':[]
"
instead of'
(e.g."a" -> "a":[]
)? \$\endgroup\$"
and'
are syntactically different. \$\endgroup\$