summaryrefslogtreecommitdiff
path: root/compiler/utils/FV.hs
diff options
context:
space:
mode:
authorTobias Dammers <tdammers@gmail.com>2018-09-10 11:13:36 +0200
committerTobias Dammers <tdammers@gmail.com>2018-09-10 11:13:36 +0200
commitc8a1f9c42a37eb0c3514aef1a716fdbcb912da31 (patch)
tree394227e7179038fcacc8b34178e18f7566a3e40a /compiler/utils/FV.hs
parent510c5f4f22aca29a9c36fd993ac79e9077b28173 (diff)
downloadhaskell-wip/T14880-2.tar.gz
14880, part 0: insertion orderwip/T14880-2
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.