Use case matching instead of null
Using null followed by a head, tail, or a partial pattern match is an anti-pattern. Use case matching instead.
This commit is contained in:
parent
8a005526cc
commit
76b798394f
|
@ -329,12 +329,11 @@ getCurrentContexts = Ms.gets contextStack
|
||||||
|
|
||||||
popContext = do
|
popContext = do
|
||||||
v <- getCurrentContexts
|
v <- getCurrentContexts
|
||||||
if not $ null v
|
case v of
|
||||||
then do
|
(a:r) -> do
|
||||||
let (a:r) = v
|
|
||||||
setCurrentContexts r
|
setCurrentContexts r
|
||||||
return $ Just a
|
return $ Just a
|
||||||
else
|
[] ->
|
||||||
return Nothing
|
return Nothing
|
||||||
|
|
||||||
pushContext c = do
|
pushContext c = do
|
||||||
|
|
Loading…
Reference in New Issue