diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2020-05-23 11:38:35 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2020-05-23 11:38:35 +0200 |
commit | f85f5515486504c9c3401332269a0dda20c96f1d (patch) | |
tree | e5bfbc0f80b23e6690a9d0e9c6e17ffb7fc135b7 /src/Haskell | |
parent | c3a2389203e743c874bb464c9343a2f0aab3ae62 (diff) |
Also case-reduce in a case-scrutinised expression
Diffstat (limited to 'src/Haskell')
-rw-r--r-- | src/Haskell/Rewrite.hs | 2 |
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) |