appendCode :: CodeString -> String -> CodeString
appendCode (CodeString codes count inStr) str = CodeString newCodes newCount newInString
  where
    newCodes = codes ++ [trimed]
    ((newCount, newInString), trimed) = runWriter $ countParentheses str count inStr
appendCode :: CodeString -> String -> CodeString
appendCode (CodeString codes count inStr) str = CodeString newCodes newCount newInString
  where
    newCodes = codes ++ [trimed]
    ((newCount, newInString), trimed) = runWriter $ countParentheses str count inStr
appendCode (CodeString codes count inStr) str = CodeString newCodes newCount newInString
  where
    newCodes = codes ++ [trimed]
    ((newCount, newInString), trimed) = runWriter $ countParentheses str count inStr