From 61808c8cd7b30ceaf9915e72d734c4d095ff67d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Tue, 19 Sep 2023 20:49:58 +0200 Subject: Identity extension data --- src/Storage.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Storage.hs') 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 -- cgit v1.2.3