Skip to content

Commit

Permalink
Fixed choice: Replace Proxy# applications by IndexType
Browse files Browse the repository at this point in the history
  • Loading branch information
jeltsch committed Jan 16, 2025
1 parent 9deb5aa commit 37c6cf4
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/Database/LSMTree/Internal/ChecksumHandle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ writeFilter hfs filterHandle bf =
{-# SPECIALISE writeIndexHeader ::
HasFS IO h
-> ForIndex (ChecksumHandle RealWorld h)
-> Proxy# i
-> IndexType
-> IO () #-}
writeIndexHeader ::
(MonadSTM m, PrimMonad m)
=> HasFS m h
-> ForIndex (ChecksumHandle (PrimState m) h)
-> Proxy# i
-> IndexType
-> m ()
writeIndexHeader hfs indexHandle indexTypeProxy =
writeToHandle hfs (unForIndex indexHandle) $
Expand Down
4 changes: 2 additions & 2 deletions src/Database/LSMTree/Internal/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,13 @@ instance NFData FencePointerIndex where
rnf OrdinaryIndex = ()

withIndexTypeProxyForRun :: FencePointerIndex
-> (forall i . Index i => Proxy# i -> r)
-> (forall i . Index i => IndexType -> r)
-> r
withIndexTypeProxyForRun CompactIndex cont = cont (proxy# @IndexCompact)
withIndexTypeProxyForRun OrdinaryIndex cont = cont (proxy# @IndexOrdinary)

withIndexAccTypeProxyForRun :: FencePointerIndex
-> (forall j . IndexAcc j => Proxy# j -> r)
-> (forall j . IndexAcc j => IndexType -> r)
-> r
withIndexAccTypeProxyForRun CompactIndex cont = cont (proxy# @IndexCompactAcc)
withIndexAccTypeProxyForRun OrdinaryIndex cont = cont (proxy# @IndexOrdinaryAcc)
Expand Down
4 changes: 2 additions & 2 deletions src/Database/LSMTree/Internal/Merge.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ type Mappend = SerialisedValue -> SerialisedValue -> SerialisedValue
-> HasBlockIO IO h
-> RunDataCaching
-> RunBloomFilterAlloc
-> Proxy# j
-> IndexType
-> Level
-> Mappend
-> Run.RunFsPaths
Expand All @@ -104,7 +104,7 @@ new ::
-> HasBlockIO m h
-> RunDataCaching
-> RunBloomFilterAlloc
-> Proxy# j
-> IndexType
-> Level
-> Mappend
-> Run.RunFsPaths
Expand Down
4 changes: 2 additions & 2 deletions src/Database/LSMTree/Internal/MergingRun.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ instance NFData MergeKnownCompleted where
-> ResolveSerialisedValue
-> Run.RunDataCaching
-> RunBloomFilterAlloc
-> Proxy# j
-> IndexType
-> Merge.Level
-> RunFsPaths
-> V.Vector (Ref (Run IO h))
Expand All @@ -137,7 +137,7 @@ new ::
-> ResolveSerialisedValue
-> Run.RunDataCaching
-> RunBloomFilterAlloc
-> Proxy# j
-> IndexType
-> Merge.Level
-> RunFsPaths
-> V.Vector (Ref (Run m h))
Expand Down
8 changes: 4 additions & 4 deletions src/Database/LSMTree/Internal/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fromMutable runRunDataCaching builder = do
-> HasBlockIO IO h
-> RunDataCaching
-> RunBloomFilterAlloc
-> Proxy# j
-> IndexType
-> RunFsPaths
-> WriteBuffer
-> Ref (WriteBufferBlobs IO h)
Expand All @@ -223,7 +223,7 @@ fromWriteBuffer ::
-> HasBlockIO m h
-> RunDataCaching
-> RunBloomFilterAlloc
-> Proxy# j
-> IndexType
-> RunFsPaths
-> WriteBuffer
-> Ref (WriteBufferBlobs m h)
Expand Down Expand Up @@ -256,7 +256,7 @@ data FileFormatError = FileFormatError FS.FsPath String
HasFS IO h
-> HasBlockIO IO h
-> RunDataCaching
-> Proxy# i
-> IndexType
-> RunFsPaths
-> IO (Ref (Run IO h)) #-}
-- | Load a previously written run from disk, checking each file's checksum
Expand All @@ -272,7 +272,7 @@ openFromDisk ::
=> HasFS m h
-> HasBlockIO m h
-> RunDataCaching
-> Proxy# i
-> IndexType
-> RunFsPaths
-> m (Ref (Run m h))
openFromDisk fs hbio runRunDataCaching indexTypeProxy runRunFsPaths = do
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Internal/RunAcc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ data RunBloomFilterAlloc =
-- output run.
new :: NumEntries
-> RunBloomFilterAlloc
-> Proxy# j
-> IndexType
-> ST s (RunAcc s)
new (NumEntries nentries) alloc indexAccTypeProxy = do
mbloom <- case alloc of
Expand Down
4 changes: 2 additions & 2 deletions src/Database/LSMTree/Internal/RunBuilder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ data RunBuilder m h = RunBuilder {
-> RunFsPaths
-> NumEntries
-> RunBloomFilterAlloc
-> Proxy# j
-> IndexType
-> IO (RunBuilder IO h) #-}
-- | Create an 'RunBuilder' to start building a run.
--
Expand All @@ -88,7 +88,7 @@ new ::
-> RunFsPaths
-> NumEntries -- ^ an upper bound of the number of entries to be added
-> RunBloomFilterAlloc
-> Proxy# j
-> IndexType
-> m (RunBuilder m h)
new hfs hbio runBuilderFsPaths numEntries alloc indexAccTypeProxy = do
runBuilderAcc <- ST.stToIO $ RunAcc.new numEntries alloc indexAccTypeProxy
Expand Down

0 comments on commit 37c6cf4

Please sign in to comment.