Skip to content

Commit bd54088

Browse files
committed
Early support for GHC 9.4.2
We still need: * cborg * serialise which support 9.4.2. Both are addressed in well-typed/cborg#298
1 parent ec2b923 commit bd54088

File tree

9 files changed

+23
-18
lines changed

9 files changed

+23
-18
lines changed

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
index-state: 2022-02-18T00:00:00Z
1+
index-state: 2022-09-01T00:00:00Z
22

33
packages: ./io-sim
44
./io-classes

io-classes/io-classes.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ library
5151
FlexibleContexts
5252
ScopedTypeVariables
5353
RankNTypes
54-
build-depends: base >=4.9 && <4.17,
54+
build-depends: base >=4.9 && <4.18,
5555
async >=2.1,
5656
bytestring,
5757
deque,
58-
mtl >=2.2 && <2.3,
58+
mtl >=2.2 && <2.4,
5959
stm >=2.5 && <2.6,
60-
time >=1.9.1 && <1.11
60+
time >=1.9.1 && <1.13
6161
ghc-options: -Wall
6262
-Wno-unticked-promoted-constructors
6363
-Wcompat

io-classes/src/Control/Monad/Class/MonadMVar.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE DefaultSignatures #-}
22
{-# LANGUAGE QuantifiedConstraints #-}
33
{-# LANGUAGE TypeFamilyDependencies #-}
4+
{-# LANGUAGE TypeOperators #-}
45

56
module Control.Monad.Class.MonadMVar
67
( MonadMVar (..)

io-classes/src/Control/Monad/Class/MonadSTM.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
{-# LANGUAGE StandaloneDeriving #-}
1313
{-# LANGUAGE TypeFamilies #-}
1414
{-# LANGUAGE TypeFamilyDependencies #-}
15+
{-# LANGUAGE TypeOperators #-}
1516
-- undecidable instances needed for 'WrappedSTM' instances of 'MonadThrow' and
1617
-- 'MonadCatch' type classes.
1718
{-# LANGUAGE UndecidableInstances #-}
19+
1820
module Control.Monad.Class.MonadSTM
1921
( MonadSTM (..)
2022
, MonadLabelledSTM (..)

io-sim/io-sim.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ library
4949
RankNTypes,
5050
ScopedTypeVariables,
5151
TypeFamilies
52-
build-depends: base >=4.9 && <4.17,
52+
build-depends: base >=4.9 && <4.18,
5353
io-classes >=0.2 && <0.3,
5454
exceptions >=0.10,
5555
containers,
@@ -58,7 +58,7 @@ library
5858
pretty-simple,
5959
psqueues >=0.2 && <0.3,
6060
text,
61-
time >=1.9.1 && <1.11,
61+
time >=1.9.1 && <1.13,
6262
quiet,
6363
QuickCheck,
6464
syb
@@ -94,7 +94,7 @@ test-suite test
9494
tasty,
9595
tasty-quickcheck,
9696
tasty-hunit,
97-
time >= 1.9.1
97+
time
9898

9999
ghc-options: -Wall
100100
-fno-ignore-asserts

io-sim/src/Control/Monad/IOSim/Internal.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,17 +1046,17 @@ saveTVar TVar{tvarCurrent, tvarUndo} = do
10461046
revertTVar :: TVar s a -> ST s ()
10471047
revertTVar TVar{tvarCurrent, tvarUndo} = do
10481048
-- pop the undo stack, and revert the current value
1049-
(v:vs) <- readSTRef tvarUndo
1050-
!_ <- writeSTRef tvarCurrent v
1051-
!_ <- writeSTRef tvarUndo vs
1049+
vs <- readSTRef tvarUndo
1050+
!_ <- writeSTRef tvarCurrent (head vs)
1051+
!_ <- writeSTRef tvarUndo (tail vs)
10521052
return ()
10531053
{-# INLINE revertTVar #-}
10541054

10551055
commitTVar :: TVar s a -> ST s ()
10561056
commitTVar TVar{tvarUndo} = do
1057+
vs <- readSTRef tvarUndo
10571058
-- pop the undo stack, leaving the current value unchanged
1058-
(_:vs) <- readSTRef tvarUndo
1059-
!_ <- writeSTRef tvarUndo vs
1059+
!_ <- writeSTRef tvarUndo (tail vs)
10601060
return ()
10611061
{-# INLINE commitTVar #-}
10621062

io-sim/src/Control/Monad/IOSimPOR/Internal.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,16 +1264,16 @@ saveTVar TVar{tvarCurrent, tvarUndo} = do
12641264
revertTVar :: TVar s a -> ST s ()
12651265
revertTVar TVar{tvarCurrent, tvarUndo} = do
12661266
-- pop the undo stack, and revert the current value
1267-
(v:vs) <- readSTRef tvarUndo
1268-
writeSTRef tvarCurrent v
1269-
writeSTRef tvarUndo vs
1267+
vs <- readSTRef tvarUndo
1268+
writeSTRef tvarCurrent (head vs)
1269+
writeSTRef tvarUndo (tail vs)
12701270
{-# INLINE revertTVar #-}
12711271

12721272
commitTVar :: TVar s a -> ST s ()
12731273
commitTVar TVar{tvarUndo} = do
1274+
vs <- readSTRef tvarUndo
12741275
-- pop the undo stack, leaving the current value unchanged
1275-
(_:vs) <- readSTRef tvarUndo
1276-
writeSTRef tvarUndo vs
1276+
writeSTRef tvarUndo (tail vs)
12771277
{-# INLINE commitTVar #-}
12781278

12791279
readTVarUndos :: TVar s a -> ST s [a]

strict-stm/src/Control/Monad/Class/MonadSTM/Strict.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{-# LANGUAGE FlexibleContexts #-}
55
{-# LANGUAGE NamedFieldPuns #-}
66
{-# LANGUAGE TypeFamilies #-}
7+
{-# LANGUAGE TypeOperators #-}
78

89
-- to preserve 'HasCallstack' constraint on 'checkInvariant'
910
{-# OPTIONS_GHC -Wno-redundant-constraints #-}

strict-stm/strict-stm.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ maintainer:
1414
category: Control
1515
build-type: Simple
1616
cabal-version: >=1.10
17+
tested-with: GHC == 8.10.7, GHC == 9.2.2
1718

1819
source-repository head
1920
type: git
@@ -35,7 +36,7 @@ library
3536

3637
exposed-modules: Control.Monad.Class.MonadSTM.Strict
3738
default-language: Haskell2010
38-
build-depends: base >=4.9 && <4.17,
39+
build-depends: base >=4.9 && <4.18,
3940
stm >=2.5 && <2.6,
4041
io-classes
4142
ghc-options: -Wall

0 commit comments

Comments
 (0)