aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-05-23 11:38:35 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-05-23 11:38:35 +0200
commitf85f5515486504c9c3401332269a0dda20c96f1d (patch)
treee5bfbc0f80b23e6690a9d0e9c6e17ffb7fc135b7
parentc3a2389203e743c874bb464c9343a2f0aab3ae62 (diff)
Also case-reduce in a case-scrutinised expression
-rw-r--r--src/Haskell/Rewrite.hs2
1 files changed, 1 insertions, 1 deletions
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)