Skip to content

Commit

Permalink
WIP: Make it build with ghc-9.10
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Jul 15, 2024
1 parent 793b56d commit c083365
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions fs-api/fs-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ library

default-language: Haskell2010
build-depends:
, base >=4.14 && <4.20
, base >=4.14 && <4.21
, bytestring >=0.10 && <0.13
, containers >=0.5 && <0.7
, containers >=0.5 && <0.8
, deepseq
, digest
, directory >=1.3 && <1.4
, filepath >=1.4 && <1.5
, filepath >=1.4 && <1.6
, io-classes >=0.3 && <1.6
, primitive ^>=0.9
, safe-wild-cards ^>=1.0
Expand Down
7 changes: 4 additions & 3 deletions fs-sim/fs-sim.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ library
other-modules: System.FS.Sim.Prim
default-language: Haskell2010
build-depends:
, base >=4.14 && <4.20
, base >=4.14 && <4.21
, base16-bytestring
, bytestring >=0.10 && <0.13
, containers >=0.5 && <0.7
, containers >=0.5 && <0.8
, fs-api ^>=0.2
, io-classes >=0.3 && <1.6
, mtl
Expand Down Expand Up @@ -86,7 +86,8 @@ test-suite fs-sim-test
, pretty-show
, primitive
, QuickCheck
, quickcheck-state-machine >=0.7.2 && <0.8
-- Earlier versions do not compile with ghc-9.10
, quickcheck-state-machine ^>=0.10
, random
, safe-wild-cards
, strict-stm
Expand Down
8 changes: 6 additions & 2 deletions fs-sim/test/Test/System/FS/StateMachine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ mock model cmd = At <$> bitraverse (const QSM.genSym) (const QSM.genSym) resp

precondition :: Model Symbolic -> Cmd :@ Symbolic -> QSM.Logic
precondition m@Model{..} (At cmd) =
QSM.forall (handles cmd) (`QSM.member` RE.keys knownHandles)
QSM.forAll (handles cmd) (`QSM.member` RE.keys knownHandles)
QSM.:&& QSM.Boolean (Mock.numOpenHandles mockFS < maxNumOpenHandles)
QSM.:&& QSM.Not (knownLimitation m (At cmd))
where
Expand Down Expand Up @@ -1571,6 +1571,10 @@ instance ToExpr (Handle h) where
toExpr = defaultExprViaShow

deriving instance ToExpr (Model Concrete)
deriving instance ToExpr (Concrete (Handle HandleIO))
deriving instance ToExpr (QSM.Reference (Handle HandleIO) Concrete)
deriving instance ToExpr (QSM.Reference FsPath Concrete)
deriving instance Generic (Concrete (Handle HandleIO))

{-------------------------------------------------------------------------------
Top-level tests
Expand Down Expand Up @@ -1626,7 +1630,7 @@ runCmds cmds = QC.monadicIO $ do
hfs = ioHasFS mount
sm' = sm hfs

(hist, model, res) <- QSM.runCommands' (pure sm') cmds
(hist, model, res) <- QSM.runCommands' sm' cmds

-- Close all open handles
forM_ (RE.keys (knownHandles model)) $ hClose hfs . QSM.concrete
Expand Down
6 changes: 5 additions & 1 deletion fs-sim/test/Test/Util/RefEnv.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TupleSections #-}

-- | Environments of QSM references.
Expand Down Expand Up @@ -35,7 +37,9 @@ import Test.StateMachine (Reference)
import qualified Test.StateMachine.Types.Rank2 as Rank2

data RefEnv k a r = RefEnv { toList :: [(Reference k r, a)] }
deriving (Generic, ToExpr, Show)
deriving (Generic, Show)

deriving instance (ToExpr a, ToExpr (Reference k r)) => ToExpr (RefEnv k a r)

-- | Extend mapping
--
Expand Down

0 comments on commit c083365

Please sign in to comment.