mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 21:11:35 -07:00
Merge pull request #1826 from josephcsible/nofromjust
Use the Identity monad to avoid unnecessary uses of fromJust
This commit is contained in:
commit
d0beac6d0b
5 changed files with 20 additions and 16 deletions
|
@ -30,6 +30,7 @@ import ShellCheck.Regex
|
|||
import Control.Monad
|
||||
import Control.Monad.RWS
|
||||
import Data.Char
|
||||
import Data.Functor.Identity
|
||||
import Data.List
|
||||
import Data.Maybe
|
||||
import qualified Data.Map as Map
|
||||
|
@ -487,7 +488,7 @@ checkBraceExpansionVars = ForShell [Bash] f
|
|||
T_DollarExpansion {} -> return "$"
|
||||
T_DollarArithmetic {} -> return "$"
|
||||
_ -> return "-"
|
||||
toString t = fromJust $ getLiteralStringExt literalExt t
|
||||
toString t = runIdentity $ getLiteralStringExt literalExt t
|
||||
isEvaled t = do
|
||||
cmd <- getClosestCommandM t
|
||||
return $ maybe False (`isUnqualifiedCommand` "eval") cmd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue