I am writing a Haskell function that operates on a list of ByteString
values. I need to do a different operation on the first and last items (which may be the same if the list has only one item).
Specifically, I want to write out the following:
"item-1\
\item-2\
\item-3\
...
\item-n"
where item-1
starts with a double quote and ends with a backslash and item-n
starts with a backslash and ends with a double quote. All items between item-1
and item-n
start and end with backslashes. I am emitting a base64 encoded value as a Haskell String
for some code generation. I have already broken the original (long) base64-encoded ByteString
into chunks that are 64 characters long each.