From f85f5515486504c9c3401332269a0dda20c96f1d Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sat, 23 May 2020 11:38:35 +0200 Subject: Also case-reduce in a case-scrutinised expression --- src/Haskell/Rewrite.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Haskell/Rewrite.hs b/src/Haskell/Rewrite.hs index 301bdb4..7eaadea 100644 --- a/src/Haskell/Rewrite.hs +++ b/src/Haskell/Rewrite.hs @@ -44,7 +44,7 @@ etared e = recurse id etared e casered :: Bool -> Expr -> Expr casered ambig orig@(Case subj arms) = - case catMaybes [(,rhs) <$> unify p subj | (p, rhs) <- arms] of + case catMaybes [(,rhs) <$> unify p (casered ambig subj) | (p, rhs) <- arms] of [] -> recurse id (casered ambig) orig ((mp, rhs):rest) -> let res = foldl' (\e' (n, rhs') -> rewrite n rhs' e') rhs (Map.assocs mp) -- cgit v1.2.3-70-g09d2