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:
Joseph C. Sible 2020-02-01 23:07:16 -05:00
parent 8a005526cc
commit 76b798394f
1 changed files with 3 additions and 4 deletions

View File

@ -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