Linter Output REPL
Since our program seems to be functional we can do some refactoring and refinement.
Therefore I believe it's a good idea to share the linter output for InterpreterUI.hs
.
It's totally up to you whether you follow these guidelines or not.
src/InterpreterUI.hs|89 col 36-53 info| Suggestion: Redundant bracket. Found: if (snd newFProgram) then printEither (parseSynTree (fst newFProgram)) else putStr ("") Why not: if snd newFProgram then printEither (parseSynTree (fst newFProgram)) else putStr ("")
src/InterpreterUI.hs|91 col 49-53 warning| Warning: Redundant bracket. Found: ("") Why not: ""
src/InterpreterUI.hs|97 col 8-41 info| Suggestion: Redundant bracket. Found: (checkInputtoMain tokenizedInput) || (head tokenizedInput == Keyword "let") || (head tokenizedInput == Variablename "main") || (head tokenizedInput == Keyword "if") Why not: checkInputtoMain tokenizedInput || (head tokenizedInput == Keyword "let") || (head tokenizedInput == Variablename "main") || (head tokenizedInput == Keyword "if")
src/InterpreterUI.hs|99 col 93-114 info| Suggestion: Redundant bracket. Found: head currFProgram == (Variablename "main") Why not: head currFProgram == Variablename "main"
src/InterpreterUI.hs|100 col 39-60 info| Suggestion: Redundant bracket. Found: head tokenizedInput == (Variablename "main") Why not: head tokenizedInput == Variablename "main"
src/InterpreterUI.hs|103 col 17-35 info| Suggestion: Use null. Found: currFProgram == [] Why not: null currFProgram
src/InterpreterUI.hs|107 col 100-116 info| Suggestion: Redundant bracket. Found: head currFProgram == (Variablename a) Why not: head currFProgram == Variablename a
src/InterpreterUI.hs|113 col 18-39 info| Suggestion: Use list literal pattern. Found: ((Punctuator ";") : []) Why not: [(Punctuator ";")]
src/InterpreterUI.hs|126 col 28-49 info| Suggestion: Use list literal pattern. Found: ((Punctuator ";") : []) Why not: [(Punctuator ";")]
src/InterpreterUI.hs|126 col 53-69 info| Suggestion: Redundant bracket. Found: [(Punctuator ";")] Why not: [Punctuator ";"]
src/InterpreterUI.hs|129 col 48-77 info| Suggestion: Use infix. Found: elem (Keyword "let") precheck Why not: Keyword "let" `elem` precheck
src/InterpreterUI.hs|130 col 54-125 info| Suggestion: Redundant bracket. Found: if elem (Keyword "let") precheck then (tail (dropWhile (/= Punctuator ";") (dropWhile (/= Keyword "in") xs))) else (tail (dropWhile (/= Punctuator ";") xs)) Why not: if elem (Keyword "let") precheck then tail (dropWhile (/= Punctuator ";") (dropWhile (/= Keyword "in") xs)) else (tail (dropWhile (/= Punctuator ";") xs))
src/InterpreterUI.hs|131 col 54-95 info| Suggestion: Redundant bracket. Found: if elem (Keyword "let") precheck then (tail (dropWhile (/= Punctuator ";") (dropWhile (/= Keyword "in") xs))) else (tail (dropWhile (/= Punctuator ";") xs)) Why not: if elem (Keyword "let") precheck then (tail (dropWhile (/= Punctuator ";") (dropWhile (/= Keyword "in") xs))) else tail (dropWhile (/= Punctuator ";") xs)
src/InterpreterUI.hs|132 col 66-102 info| Suggestion: Redundant bracket. Found: if (head xs == (Variablename funcname)) then do let precheck = takeWhile (/= Punctuator ";") xs if elem (Keyword "let") precheck then [(Punctuator ";")] ++ (tail (dropWhile (/= Punctuator ";") (dropWhile (/= Keyword "in") xs))) else [(Punctuator ";")] ++ (tail (dropWhile (/= Punctuator ";") xs)) else [(Punctuator ";")] ++ removeDoubleDefinition funcname False xs Why not: if head xs == (Variablename funcname) then do let precheck = takeWhile (/= Punctuator ";") xs if elem (Keyword "let") precheck then [(Punctuator ";")] ++ (tail (dropWhile (/= Punctuator ";") (dropWhile (/= Keyword "in") xs))) else [(Punctuator ";")] ++ (tail (dropWhile (/= Punctuator ";") xs)) else [(Punctuator ";")] ++ removeDoubleDefinition funcname False xs
src/InterpreterUI.hs|132 col 78-101 info| Suggestion: Redundant bracket. Found: head xs == (Variablename funcname) Why not: head xs == Variablename funcname
src/InterpreterUI.hs|135 col 68-97 info| Suggestion: Use infix. Found: elem (Keyword "let") precheck Why not: Keyword "let" `elem` precheck
src/InterpreterUI.hs|136 col 74-167 info| Suggestion: Use :. Found: [(Punctuator ";")] ++ (tail (dropWhile (/= Punctuator ";") (dropWhile (/= Keyword "in") xs))) Why not: (Punctuator ";") : (tail (dropWhile (/= Punctuator ";") (dropWhile (/= Keyword "in") xs)))
src/InterpreterUI.hs|136 col 75-91 info| Suggestion: Redundant bracket. Found: [(Punctuator ";")] Why not: [Punctuator ";"]
src/InterpreterUI.hs|136 col 96-167 info| Suggestion: Redundant bracket. Found: [(Punctuator ";")] ++ (tail (dropWhile (/= Punctuator ";") (dropWhile (/= Keyword "in") xs))) Why not: [(Punctuator ";")] ++ tail (dropWhile (/= Punctuator ";") (dropWhile (/= Keyword "in") xs))
src/InterpreterUI.hs|137 col 74-137 info| Suggestion: Use :. Found: [(Punctuator ";")] ++ (tail (dropWhile (/= Punctuator ";") xs)) Why not: (Punctuator ";") : (tail (dropWhile (/= Punctuator ";") xs))
src/InterpreterUI.hs|137 col 75-91 info| Suggestion: Redundant bracket. Found: [(Punctuator ";")] Why not: [Punctuator ";"]
src/InterpreterUI.hs|137 col 96-137 info| Suggestion: Redundant bracket. Found: [(Punctuator ";")] ++ (tail (dropWhile (/= Punctuator ";") xs)) Why not: [(Punctuator ";")] ++ tail (dropWhile (/= Punctuator ";") xs)
src/InterpreterUI.hs|138 col 66-128 info| Suggestion: Use :. Found: [(Punctuator ";")] ++ removeDoubleDefinition funcname False xs Why not: (Punctuator ";") : removeDoubleDefinition funcname False xs
src/InterpreterUI.hs|138 col 67-83 info| Suggestion: Redundant bracket. Found: [(Punctuator ";")] Why not: [Punctuator ";"]
src/InterpreterUI.hs|139 col 48-95 info| Suggestion: Use :. Found: [x] ++ removeDoubleDefinition funcname False xs Why not: x : removeDoubleDefinition funcname False xs