Skip to content

Commit bccbece

Browse files
authored
Merge pull request #181 from Ericson2314/ghc-9.2-reconcile
Bring in changes GHC 9.2 is using
2 parents b86e9a7 + 27d0284 commit bccbece

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Data/Binary/Class.hs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
{-# LANGUAGE PolyKinds #-}
1010
#endif
1111

12+
#if MIN_VERSION_base(4,16,0)
13+
#define HAS_TYPELITS_CHAR
14+
#endif
15+
1216
#if MIN_VERSION_base(4,8,0)
1317
#define HAS_NATURAL
1418
#define HAS_VOID
@@ -962,11 +966,17 @@ instance Binary KindRep where
962966
instance Binary TypeLitSort where
963967
put TypeLitSymbol = putWord8 0
964968
put TypeLitNat = putWord8 1
969+
#ifdef HAS_TYPELITS_CHAR
970+
put TypeLitChar = putWord8 2
971+
#endif
965972
get = do
966973
tag <- getWord8
967974
case tag of
968975
0 -> pure TypeLitSymbol
969976
1 -> pure TypeLitNat
977+
#ifdef HAS_TYPELITS_CHAR
978+
2 -> pure TypeLitChar
979+
#endif
970980
_ -> fail "GHCi.TH.Binary.putTypeLitSort: invalid tag"
971981

972982
putTypeRep :: TypeRep a -> Put
@@ -1046,4 +1056,3 @@ instance Binary SomeTypeRep where
10461056
put (SomeTypeRep rep) = putTypeRep rep
10471057
get = getSomeTypeRep
10481058
#endif
1049-

0 commit comments

Comments
 (0)