Q:

Recursive function put character in front of list only once

So I have to write a recursive function which replaces the given word list with letters using a former function. That part works perfectly. But I also have to put a '|' symbol in front of the list and the same symbol and a '\n' symbol after the list. I have this code right now:
showRow [] = []
showRow (x:xs) = '|' : showCell x : showRow xs ++ ['|'] ++ ['\n']

This puts the first symbol before every letter and the two other symbols after the list multiple times. How can I add these symbols to the start and end of the list only once within this function?

A:

This is not the right solution for your problem (follow the recommended map method in the comments), but to show one way of handling recursive function with different first and last behavior
showRow [] = []
showRow x = go x True
    where go x True   = '|': go x False
          go [] _     = "\n"
          go (x:xs) _ = (showCell x) ++ ('|': go xs False)

a dummy boolean triggers the initial value handling and empty list triggers the final value handing.

