ban-instance (hackage):   Banning an instance allows the programmer to actively declare that an instance should never be defined, and provide a reason why:    [Index] [Quick Jump]  Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.  Package maintainers  For package maintainers and hackage trustees  Candidates        Code that attempts to use the banned instance will generate a custom error message:  Banning an instance allows the programmer to actively declare that this instance should never be defined, and provide a reason why. In terms of what programs the compiler will accept, banning an instance is the same as leaving it undefined.  Our main use case is banning ToJSON/FromJSON instances on "core" data structures to ensure serialisation/deserialisation is defined at API boundaries. We have systems which send and receive values of similar types over multiple different APIs, and which need to vary their JSON representations independently to allow upgrades. Defining serialisation on core data types means that changes to the ToJSON/FromJSON instance can cause breakage at the API layer of some unrelated system, on the other side of the codebase. Better to ban ToJSON/FromJSON on the core data types, and define types for presentation that live alongside the rest of the API:
Keywords: bsd3|haskell|library