I am trying to insert a character ('A') into a string in Haskell my code is as follows:
split :: Int -> String -> String
split n s
|s == [] = s
|otherwise = let (a,b) = splitAt n s in “A” ++ split n b
However, it keeps throwing up " lexical error at character '\8220' " on the otherwise line. Im new to Haskell and any help would be much appreciated.
Change
“
to"
. It's a different Unicode character. You have“
which is left double quation mark while the standard lexical element is the simple quotation mark ("
)Also, since you're adding a single letter, you can also use
'A' : split n b