diff --git a/int/Pantry/SHA256.hs b/int/Pantry/SHA256.hs index 13bca111..841983c3 100644 --- a/int/Pantry/SHA256.hs +++ b/int/Pantry/SHA256.hs @@ -47,7 +47,10 @@ import qualified Data.ByteArray import qualified Data.ByteArray.Encoding as Mem import Data.StaticBytes ( Bytes32, StaticBytesException, toStaticExact ) -import Database.Persist.Sql +import Database.Persist.Class.PersistField ( PersistField (..) ) +import Database.Persist.PersistValue ( PersistValue (..) ) +import Database.Persist.Sql ( PersistFieldSql (..) ) +import Database.Persist.Types ( SqlType (..) ) import RIO import qualified RIO.Text as T diff --git a/src/Pantry/Casa.hs b/src/Pantry/Casa.hs index 1b0201c0..45e630af 100644 --- a/src/Pantry/Casa.hs +++ b/src/Pantry/Casa.hs @@ -13,6 +13,10 @@ import qualified Data.HashMap.Strict as HM import qualified Pantry.SHA256 as SHA256 import Pantry.Storage ( storeBlob, withStorage ) import Pantry.Types as P + ( BlobKey (..), FileSize (..), HasPantryConfig (..) + , PantryConfig (..), PantryException (..), Tree, TreeKey (..) + , parseTreeM + ) import RIO import qualified RIO.ByteString as B diff --git a/src/Pantry/HTTP.hs b/src/Pantry/HTTP.hs index 15058203..95946bf9 100644 --- a/src/Pantry/HTTP.hs +++ b/src/Pantry/HTTP.hs @@ -37,8 +37,8 @@ import qualified RIO.Text as T setUserAgent :: Request -> Request setUserAgent = setRequestHeader "User-Agent" ["Haskell pantry package"] -withResponse - :: MonadUnliftIO m +withResponse :: + MonadUnliftIO m => HTTP.Request -> (Response BodyReader -> m a) -> m a @@ -46,15 +46,15 @@ withResponse req inner = withRunInIO $ \run -> do manager <- getGlobalManager HTTP.withResponse (setUserAgent req) manager (run . inner) -httpSink - :: MonadUnliftIO m +httpSink :: + MonadUnliftIO m => Request -> (Response () -> ConduitT ByteString Void m a) -> m a httpSink req = HTTP.httpSink (setUserAgent req) -httpSinkChecked - :: MonadUnliftIO m +httpSinkChecked :: + MonadUnliftIO m => Text -> Maybe SHA256 -> Maybe FileSize diff --git a/src/Pantry/Hackage.hs b/src/Pantry/Hackage.hs index 2b0fcc90..e7ed1cb4 100644 --- a/src/Pantry/Hackage.hs +++ b/src/Pantry/Hackage.hs @@ -131,8 +131,8 @@ data HackageTarballResult = HackageTarballResult -- sanity. See the return value to find out if it happened. -- -- @since 0.1.0.0 -updateHackageIndex - :: (HasPantryConfig env, HasLogFunc env) +updateHackageIndex :: + (HasPantryConfig env, HasLogFunc env) => Maybe Utf8Builder -- ^ reason for updating, if any -> RIO env DidUpdateOccur updateHackageIndex = updateHackageIndexInternal False @@ -142,15 +142,15 @@ updateHackageIndex = updateHackageIndexInternal False -- sure the database is in sync with the locally downloaded tarball -- -- @since 0.1.0.0 -forceUpdateHackageIndex - :: (HasPantryConfig env, HasLogFunc env) +forceUpdateHackageIndex :: + (HasPantryConfig env, HasLogFunc env) => Maybe Utf8Builder -> RIO env DidUpdateOccur forceUpdateHackageIndex = updateHackageIndexInternal True -updateHackageIndexInternal - :: (HasPantryConfig env, HasLogFunc env) +updateHackageIndexInternal :: + (HasPantryConfig env, HasLogFunc env) => Bool -- ^ Force the database update. -> Maybe Utf8Builder -- ^ reason for updating, if any -> RIO env DidUpdateOccur diff --git a/src/Pantry/Repo.hs b/src/Pantry/Repo.hs index b6e6999c..0485c657 100644 --- a/src/Pantry/Repo.hs +++ b/src/Pantry/Repo.hs @@ -15,7 +15,7 @@ module Pantry.Repo , withRepo ) where -import Database.Persist ( Entity (..) ) +import Database.Persist.Class.PersistEntity ( Entity (..) ) import Pantry.Archive ( getArchivePackage ) import Pantry.Storage ( getTreeForKey, loadPackageById, loadRepoCache diff --git a/src/Pantry/SQLite.hs b/src/Pantry/SQLite.hs index 4e8f18c5..8971cfd7 100644 --- a/src/Pantry/SQLite.hs +++ b/src/Pantry/SQLite.hs @@ -10,13 +10,14 @@ module Pantry.SQLite import Control.Concurrent.Companion ( Companion, onCompanionDone, withCompanion ) +import Database.Persist.Sql ( runSqlConn ) +import Database.Persist.Sql.Migration + ( Migration, runMigrationSilent ) import Database.Persist.Sqlite - ( Migration, extraPragmas, fkEnabled, mkSqliteConnectionInfo - , runMigrationSilent, runSqlConn, walEnabled - , withSqliteConnInfo + ( extraPragmas, fkEnabled, mkSqliteConnectionInfo + , walEnabled, withSqliteConnInfo ) -import Pantry.Types - ( PantryException (MigrationFailure), Storage (..) ) +import Pantry.Types ( PantryException (..), Storage (..) ) import Path ( Abs, File, Path, parent, toFilePath ) import Path.IO ( ensureDir ) import RIO hiding ( FilePath )