diff options
Diffstat (limited to 'src/Storage.hs')
-rw-r--r-- | src/Storage.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Storage.hs b/src/Storage.hs index 47477df..93a34c5 100644 --- a/src/Storage.hs +++ b/src/Storage.hs @@ -4,7 +4,7 @@ module Storage ( deriveEphemeralStorage, derivePartialStorage, Ref, PartialRef, RefDigest, - refStorage, refDigest, + refDigest, readRef, showRef, showRefDigest, refDigestFromByteString, hashToRefDigest, copyRef, partialRef, partialRefFromDigest, @@ -18,7 +18,7 @@ module Storage ( Head, HeadType(..), HeadTypeID, mkHeadTypeID, - headId, headRef, headObject, headStoredObject, + headId, headStorage, headRef, headObject, headStoredObject, loadHeads, loadHead, reloadHead, storeHead, replaceHead, updateHead, updateHead_, @@ -359,6 +359,9 @@ type Head = Head' Complete headId :: Head a -> HeadID headId (Head uuid _) = uuid +headStorage :: Head a -> Storage +headStorage = refStorage . headRef + headRef :: Head a -> Ref headRef (Head _ sx) = storedRef sx @@ -431,7 +434,7 @@ storeHead st obj = liftIO $ do replaceHead :: forall a m. (HeadType a, MonadIO m) => Head a -> Stored a -> m (Either (Maybe (Head a)) (Head a)) replaceHead prev@(Head hid pobj) stored = liftIO $ do - let st = storedStorage pobj + let st = headStorage prev tid = headTypeID @a Proxy case stBacking st of StorageDir { dirPath = spath } -> do |