[Haskell-cafe] Introducing Instances in GHC point releases

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu May 21 18:34:22 EDT 2009

On Thu, 2009-05-21 at 15:22 -0700, Alexander Dunlap wrote:
> Since those types come out of the time library, and that library's
> version *has* been bumped (I assume), couldn't you use Cabal to
> condition on the version of the time library to determine whether or
> not to have CPP set a -DTYPEABLE_IN_TIME flag, and then #ifdef out
> your versions of the instances?

I was about to suggest this:

#if MIN_VERSION_time(1,1,2)

because Cabal 1.6+ generates these cpp macros for you. Note that relying
on the value of __GLASGOW_HASKELL__ would be wrong because the version
of the time library is not directly related to the version of ghc.

However, I note that all the recent versions of time are 1.1.2.x which
means it didn't bump the API version when it added the instances. 

The PVP says:

        A.B is known as the major version number, and C the minor
        version number. When a package is updated, the following rules
        govern how the version number must change relative to the
        previous version:
             1. If any entity was removed, or the types of any entities
                or the definitions of datatypes or classes were changed,
                or instances were added or removed, then the new A.B
                must be greater than the previous A.B.


More information about the Haskell-Cafe mailing list