diff options
author | Bartosz Nitka <niteria@gmail.com> | 2016-06-06 07:38:03 -0700 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2016-06-06 07:40:00 -0700 |
commit | 46d2da00ddb8756d966a5ba491b618367911de0f (patch) | |
tree | a9b97a9c028cd9bc15ed34d809edb86481f20029 | |
parent | 31ba8d645d24b16324eb66fd07f007710fdd8ba9 (diff) | |
download | haskell-46d2da00ddb8756d966a5ba491b618367911de0f.tar.gz |
Document putDictionary determinism
Summary: Like explained in the comment it's OK here.
Test Plan: ./validate
Reviewers: simonmar, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2306
GHC Trac Issues: #4012
-rw-r--r-- | compiler/utils/Binary.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs index 8800d98f9c..9f8d926749 100644 --- a/compiler/utils/Binary.hs +++ b/compiler/utils/Binary.hs @@ -650,7 +650,9 @@ type Dictionary = Array Int FastString -- The dictionary putDictionary :: BinHandle -> Int -> UniqFM (Int,FastString) -> IO () putDictionary bh sz dict = do put_ bh sz - mapM_ (putFS bh) (elems (array (0,sz-1) (eltsUFM dict))) + mapM_ (putFS bh) (elems (array (0,sz-1) (nonDetEltsUFM dict))) + -- It's OK to use nonDetEltsUFM here because the elements have indices + -- that array uses to create order getDictionary :: BinHandle -> IO Dictionary getDictionary bh = do |