D.Compat.Binary: backport binary generics to binary-0.5
GHC generics are used to derive binary instances for types appearing in the persistent build config, which requires GHC >= 7.2 and binary >= 0.7. Unfortunately, GHC < 7.8 ships with binary == 0.5.*. The missing module is Data.Binary.Generics, which we have copied from binary-0.7.2.3 to Distribution.Compat.Binary.Generics. To provide generic implementations for the Binary class, we also have to provide our own implementation, which is copied from binary-0.7.2.3 to Distribution.Compat.Binary.Class. The interface required by Cabal is exported from Distribution.Compat.Binary. This is only done if bootstrapping Cabal with GHC < 7.8 or if binary >= 0.7 is not available, otherwise Distribution.Compat.Binary simply re-exports Data.Binary.
Showing with 751 additions and 23 deletions