mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-28 00:07:03 +08:00
Use <$> instead of >>= and return
This commit is contained in:
@@ -997,7 +997,7 @@ handleCommand cmd vars args literalCmd = do
|
||||
(names, flags) = partition (null . fst) pairs
|
||||
flagNames = map fst flags
|
||||
literalNames :: [(Token, String)] -- Literal names to unset, e.g. [(myfuncToken, "myfunc")]
|
||||
literalNames = mapMaybe (\(_, t) -> getLiteralString t >>= (return . (,) t)) names
|
||||
literalNames = mapMaybe (\(_, t) -> (,) t <$> getLiteralString t) names
|
||||
-- Apply a constructor like CFUndefineVariable to each literalName, and tag with its id
|
||||
unsetWith c = newNodeRange $ CFApplyEffects $ map (\(token, name) -> IdTagged (getId token) $ c name) literalNames
|
||||
|
||||
|
Reference in New Issue
Block a user