@@ -856,22 +856,31 @@ applyPatchGHCiMessage ghcFlavor =
856856 " #if MIN_VERSION_ghc_heap(8,11,0)"
857857 (unlines rs <> " #if MIN_VERSION_ghc_heap(8,11,0)" )
858858 . replace
859- (unlines
860- [ " #if MIN_VERSION_ghc_internal(9,1500,0)"
861- , " instance Binary Heap.HalfWord where"
862- , " put x = put (fromIntegral x :: Word32)"
863- , " get = fromIntegral <$> (get :: Get Word32)"
864- , " #endif"
865- ])
866- (unlines
867- [ " instance Binary Heap.HalfWord where"
868- , " put x = put (fromIntegral x :: Word32)"
869- , " get = fromIntegral <$> (get :: Get Word32)"
870- ])
859+ (unlines $
860+ [ " #if MIN_VERSION_ghc_internal(9,1500,0)" ] ++
861+ binaryHeapHalfWordInstanceLines ++
862+ [" #endif" ]
863+ )
864+ binaryHeapHalfWordInstance
865+ . replace
866+ (unlines $
867+ [ " #if MIN_VERSION_GLASGOW_HASKELL(9,12,2,20250919)" ] ++
868+ binaryHeapHalfWordInstanceLines ++
869+ [" #endif" ]
870+ )
871+ binaryHeapHalfWordInstance
871872 =<< readFile' messageHs
872873 where
873874 messageHs = " libraries/ghci/GHCi/Message.hs"
874875
876+ binaryHeapHalfWordInstanceLines =
877+ [ " instance Binary Heap.HalfWord where"
878+ , " put x = put (fromIntegral x :: Word32)"
879+ , " get = fromIntegral <$> (get :: Get Word32)"
880+ ]
881+
882+ binaryHeapHalfWordInstance = unlines binaryHeapHalfWordInstanceLines
883+
875884applyPatchHaddockHs :: GhcFlavor -> IO ()
876885applyPatchHaddockHs ghcFlavor = do
877886 -- See https://github.com/ndmitchell/hlint/issues/1224
0 commit comments