Skip to content

Commit e71c634

Browse files
authored
Merge pull request #552 from IntersectMBO/wenkokke/specialise-checksum-rw
fix: specialise writeFileSnapshotMetaData and readFileSnapshotMetaData
2 parents 98777f8 + 3d9909d commit e71c634

File tree

1 file changed

+15
-0
lines changed
  • src/Database/LSMTree/Internal/Snapshot

1 file changed

+15
-0
lines changed

src/Database/LSMTree/Internal/Snapshot/Codec.hs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ isCompatible otherVersion = do
7676
Writing and reading files
7777
-------------------------------------------------------------------------------}
7878

79+
{-# SPECIALIZE
80+
writeFileSnapshotMetaData ::
81+
HasFS IO h
82+
-> FsPath
83+
-> FsPath
84+
-> SnapshotMetaData
85+
-> IO ()
86+
#-}
7987
-- | Encode 'SnapshotMetaData' and write it to 'SnapshotMetaDataFile'.
8088
--
8189
-- In the presence of exceptions, newly created files will not be removed. It is
@@ -96,6 +104,13 @@ writeFileSnapshotMetaData hfs contentPath checksumPath snapMetaData = do
96104
checksumFile = Map.singleton checksumFileName checksum
97105
writeChecksumsFile hfs checksumPath checksumFile
98106

107+
{-# SPECIALIZE
108+
readFileSnapshotMetaData ::
109+
HasFS IO h
110+
-> FsPath
111+
-> FsPath
112+
-> IO (Either DeserialiseFailure SnapshotMetaData)
113+
#-}
99114
-- | Read from 'SnapshotMetaDataFile' and attempt to decode it to
100115
-- 'SnapshotMetaData'.
101116
readFileSnapshotMetaData ::

0 commit comments

Comments
 (0)