Use maybe instead of fromMaybe and fmap

This commit is contained in:
Joseph C. Sible 2020-02-01 22:50:17 -05:00
parent f5c6771016
commit 28978a8b65
3 changed files with 9 additions and 9 deletions

View file

@ -784,8 +784,8 @@ isCommand token str = isCommandMatch token (\cmd -> cmd == str || ('/' : str) `
-- Compare a command to a literal. Like above, but checks full path.
isUnqualifiedCommand token str = isCommandMatch token (== str)
isCommandMatch token matcher = fromMaybe False $
fmap matcher (getCommandName token)
isCommandMatch token matcher = maybe False
matcher (getCommandName token)
-- Does this regex look like it was intended as a glob?
-- True: *foo*