vscode-haskell-linter icon indicating copy to clipboard operation
vscode-haskell-linter copied to clipboard

Substitution isn't done corectly

Open hanjoosten opened this issue 4 years ago • 0 comments

Consider the following code snipet:

instance Traversable P_BoxItem where
 traverse f (P_BxExpr nm pos' ctx mCrud mView msub)
  = (\ctx' msub'->(P_BxExpr nm pos' ctx' mCrud mView msub')) <$>
     traverse f ctx <*> traverse (traverse f) msub
 traverse _ (P_BxTxt  nm pos' str) = pure (P_BxTxt  nm pos' str)

hlint will warn about redundant brackets:

src/Ampersand/Core/ParseTree.hs:430:19-59: Suggestion: Redundant bracket
Found
\ ctx' msub' -> (P_BxExpr nm pos' ctx' mCrud mView msub')
Perhaps
\ ctx' msub' -> P_BxExpr nm pos' ctx' mCrud mView msub'

In vscode, using haskell-linter 0.0.6, it replaces with too much, breaking the code:

image

image final result: image

hanjoosten avatar Oct 18 '20 14:10 hanjoosten