Changing the `Binary` instance for `Double` and `Float`
Haskell Community [Unofficial]
March 7, 2026
elaforge:
was supposed to replace binary for ghc’s internal use. While the latter seems to have never happened
I think ghc only uses the binary package for the package db at this point. Most internal uses use GHC’s own Binary class:
class Binary a where
put\_ :: WriteBinHandle -> a -> IO ()
put :: WriteBinHandle -> a -> IO (Bin a)
get :: ReadBinHandle -> IO a
But while that works for GHC I wouldn’t recommend this interface for a library.
Discussion in the ATmosphere