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
|
||||
v <- getCurrentContexts
|
||||
if not $ null v
|
||||
then do
|
||||
let (a:r) = v
|
||||
case v of
|
||||
(a:r) -> do
|
||||
setCurrentContexts r
|
||||
return $ Just a
|
||||
else
|
||||
[] ->
|
||||
return Nothing
|
||||
|
||||
pushContext c = do
|
||||
|
|
Loading…
Reference in New Issue