summaryrefslogtreecommitdiff
path: root/compiler/iface
diff options
context:
space:
mode:
authorJosh Meredith <joshmeredith2008@gmail.com>2020-02-04 00:41:33 +1100
committerJosh Meredith <joshmeredith2008@gmail.com>2020-02-04 00:41:33 +1100
commit66d8196cc5b7bf6e8ecfb64166b3c5153e0bd8b8 (patch)
tree9f1f3ddfae37e818fda6010b026082abe3ad4ef2 /compiler/iface
parent58ed6c4a0999c0025b1b024bc26171fa6d6773b3 (diff)
downloadhaskell-wip/binary-reader/step1.tar.gz
Treat modified Binary UserData as a local state with a sub-actionwip/binary-reader/step1
Diffstat (limited to 'compiler/iface')
-rw-r--r--compiler/iface/BinFingerprint.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/iface/BinFingerprint.hs b/compiler/iface/BinFingerprint.hs
index 1eef4d67b4..11b6556d4d 100644
--- a/compiler/iface/BinFingerprint.hs
+++ b/compiler/iface/BinFingerprint.hs
@@ -33,13 +33,11 @@ computeFingerprint :: (Binary a)
-> a
-> IO Fingerprint
computeFingerprint put_nonbinding_name a = do
- bh <- fmap set_user_data $ openBinMem (3*1024) -- just less than a block
+ bh <- openBinMem (3*1024)
+ writeState bh put_nonbinding_name putNameLiterally putFS $ \bh -> do
put_ bh a
fp <- fingerprintBinMem bh
return fp
- where
- set_user_data bh =
- setUserData bh $ newWriteState put_nonbinding_name putNameLiterally putFS
-- | Used when we want to fingerprint a structure without depending on the
-- fingerprints of external Names that it refers to.