summaryrefslogtreecommitdiff
path: root/src/Storage.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Storage.hs')
-rw-r--r--src/Storage.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Storage.hs b/src/Storage.hs
index 69e8ab6..7edae8b 100644
--- a/src/Storage.hs
+++ b/src/Storage.hs
@@ -46,6 +46,7 @@ module Storage (
fromStored, storedRef,
wrappedStore, wrappedLoad,
copyStored,
+ unsafeMapStored,
StoreInfo(..), makeStoreInfo,
@@ -891,6 +892,10 @@ copyStored :: forall c c' m a. (StorageCompleteness c, StorageCompleteness c', M
Storage' c' -> Stored' c a -> m (LoadResult c (Stored' c' a))
copyStored st (Stored ref' x) = liftIO $ returnLoadResult . fmap (flip Stored x) <$> copyRef' st ref'
+-- |Passed function needs to preserve the object representation to be safe
+unsafeMapStored :: (a -> b) -> Stored a -> Stored b
+unsafeMapStored f (Stored ref x) = Stored ref (f x)
+
data StoreInfo = StoreInfo
{ infoDate :: ZonedTime