-- | Load a @InstalledCache@ from disk, swallowing any errors and returning an
-- empty cache.
loadInstalledCache :: (MonadLogger m, MonadIO m) => Path Abs File -> m InstalledCache
loadInstalledCache path = do
    m <- taggedDecodeOrLoad (toFilePath path) (return $ InstalledCacheInner Map.empty)
    liftIO $ fmap InstalledCache $ newIORef m

-- | Save a @InstalledCache@ to disk
loadInstalledCache :: (MonadLogger m, MonadIO m) => Path Abs File -> m InstalledCache
loadInstalledCache path = do
    m <- taggedDecodeOrLoad (toFilePath path) (return $ InstalledCacheInner Map.empty)
    liftIO $ fmap InstalledCache $ newIORef m

-- | Save a @InstalledCache@ to disk
loadInstalledCache path = do
    m <- taggedDecodeOrLoad (toFilePath path) (return $ InstalledCacheInner Map.empty)
    liftIO $ fmap InstalledCache $ newIORef m

-- | Save a @InstalledCache@ to disk