Use maybe instead of fromMaybe and fmap

This commit is contained in:
Joseph C. Sible 2024-01-02 14:46:07 -05:00
parent 67abfe159e
commit ba86c6363c
2 changed files with 2 additions and 2 deletions

View File

@ -5020,7 +5020,7 @@ checkPlusEqualsNumber params t =
let
unquotedLiteral = getUnquotedLiteral word
isEmpty = unquotedLiteral == Just ""
isUnquotedNumber = not isEmpty && fromMaybe False (all isDigit <$> unquotedLiteral)
isUnquotedNumber = not isEmpty && maybe False (all isDigit) unquotedLiteral
isNumericalVariableName = fromMaybe False $ do
str <- unquotedLiteral
CF.variableMayBeAssignedInteger state str

View File

@ -829,7 +829,7 @@ lookupStack' functionOnly get dep def ctx key = do
f (s:rest) = do
-- Go up the stack until we find the value, and add
-- a dependency on each state (including where it was found)
res <- fromMaybe (f rest) (return <$> get (stackState s) key)
res <- maybe (f rest) return (get (stackState s) key)
modifySTRef (dependencies s) $ S.insert $ dep key res
return res