From b7bbd5db4a12b378640a8c14209d0ed2105914c0 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Fri, 20 May 2022 18:41:25 +0200 Subject: [PATCH] Preparation for GHC-9.0 (#78) This fixes some would-be warnings in GHC-9.0 that we're going to switch to once https://github.com/dfinity/ic-hs/pull/76 is merged. --- src/IC/Purify.hs | 3 ++- src/IC/Test/Agent.hs | 3 +-- src/IC/Wasm/Winter/Persist.hs | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/IC/Purify.hs b/src/IC/Purify.hs index 1789b61e..d85a18c2 100644 --- a/src/IC/Purify.hs +++ b/src/IC/Purify.hs @@ -7,11 +7,12 @@ module IC.Purify where import Control.Monad.ST import Data.Functor +import Data.Kind (Type) import Data.Either import Data.Bifunctor class SnapshotAble i where - type SnapshotOf i :: * + type SnapshotOf i :: Type persist :: i s -> ST s (SnapshotOf i) recreate :: SnapshotOf i -> ST s (i s) diff --git a/src/IC/Test/Agent.hs b/src/IC/Test/Agent.hs index 9c319900..f8f6c26c 100644 --- a/src/IC/Test/Agent.hs +++ b/src/IC/Test/Agent.hs @@ -44,7 +44,6 @@ import Numeric.Natural import Data.Char import Test.Tasty.HUnit import Test.Tasty.Options -import Control.Monad.Trans import Control.Monad.Except import Control.Concurrent import Control.Exception (catch) @@ -128,7 +127,7 @@ connect :: String -> Int -> IO ReplWrapper connect ep tp = do agentConfig <- makeAgentConfig ep tp let ?agentConfig = agentConfig - return (R id) + return (R $ \x -> x) -- Yes, implicit arguments are frowned upon. But they are also very useful. diff --git a/src/IC/Wasm/Winter/Persist.hs b/src/IC/Wasm/Winter/Persist.hs index fc8119cd..cf782881 100644 --- a/src/IC/Wasm/Winter/Persist.hs +++ b/src/IC/Wasm/Winter/Persist.hs @@ -27,6 +27,7 @@ import qualified Data.IntMap as IM import qualified Data.Map.Lazy as M import qualified Data.Vector as V import Data.ByteString.Lazy (ByteString) +import Data.Kind (Type) import qualified IC.Canister.StableMemory as Stable @@ -56,8 +57,8 @@ resumeMemory :: W.MemoryInst (ST s) -> ByteString -> ST s () resumeMemory i p = resume i p class Monad (M a) => Persistable a where - type Persisted a :: * - type M a :: * -> * + type Persisted a :: Type + type M a :: Type -> Type persist :: a -> M a (Persisted a) resume :: a -> Persisted a -> M a ()