@@ -698,18 +698,18 @@ irSC top vs (Case up n alts@[ConCase cn a ns sc, DefaultCase sc']) = do
698698 -- the usual case
699699 _ -> LCase up (LV n) <$> mapM (irAlt top vs (LV n)) alts
700700
701−irSC top vs sc@(Case up n alts) = do
702− ist <- getIState
703−
704− if | [ConCase cns as nss scs, ConCase cnz az nsz scz] <- alts
701+irSC top vs sc@(Case up n alts) = getIState >>= rhs
702+ where
703+ rhs ist
704+ | [ConCase cns as nss scs, ConCase cnz az nsz scz] <- alts
705705 , Just LikeS <- isLikeNat ist cns
706− -> do
706+ = do
707707 -- reorder to make the Z case come first
708708 zCase <- LConstCase (BI 0) <$> irSC top vs scz
709709 sCase <- irAlt top vs (LV n) (ConCase cns as nss scs)
710710 return $ LCase up (LV n) [zCase, sCase]
711711
712− | otherwise -> do
712+ | otherwise = do
713713 -- check that neither alternative needs the newtype optimisation,
714714 -- see comment above
715715 goneWrong <- or <$> mapM isDetaggable alts
@@ -718,7 +718,7 @@ irSC top vs sc@(Case up n alts) = do
718718
719719 -- everything okay
720720 LCase up (LV n) <$> mapM (irAlt top vs (LV n)) alts
721− where
721+
722722 isDetaggable (ConCase cn _ _ _) = fgetState $ opt_detaggable . ist_optimisation cn
723723 isDetaggable _ = return False
724724