summaryrefslogtreecommitdiff
path: root/compiler/utils/FV.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils/FV.hs')
-rw-r--r--compiler/utils/FV.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/utils/FV.hs b/compiler/utils/FV.hs
index 6d0dc2b2ab..f4b6e28ed2 100644
--- a/compiler/utils/FV.hs
+++ b/compiler/utils/FV.hs
@@ -185,7 +185,8 @@ filterFV fv_cand2 fv fv_cand1 in_scope acc =
mapUnionFV :: (a -> FV) -> [a] -> FV
mapUnionFV _f [] _fv_cand _in_scope acc = acc
mapUnionFV f (a:as) fv_cand in_scope acc =
- mapUnionFV f as fv_cand in_scope $! f a fv_cand in_scope $! acc
+ -- NB: preserve ordering of the input list by treating a before as
+ f a fv_cand in_scope $! mapUnionFV f as fv_cand in_scope $! acc
{-# INLINABLE mapUnionFV #-}
-- | Union many free variable computations.