[Haskell-cafe] Time Typeable Instances
jgoerzen at complete.org
Tue Oct 13 09:48:20 EDT 2009
Hugo Gomes wrote:
> The Glorious Glasgow Haskell Compilation System, version 6.10.4
> with old-time-220.127.116.11 and time-18.104.22.168
> This is a standard haskell platform on a windows xp. Cabal install
> didn't work complaining about missing instances of typeable for posix
> time and other datatypes, yet, after removing the macros (thus, adding
> those instances), hdbc and convertible compiled and installed fine.
> Removing the macros might be a bit overkill, probably finetuning them so
> that they add only the necessary instances for typeable in ghc > 610
> might be a better solution.
I'm going to CC haskell-cafe on this because I am confused.
Hugo, can you confirm what version of convertible you have?
Back on May 21, I started a thread  on haskell-cafe complaining that
GHC 6.10.3 included a newer time that included instances of Typeable for
NominalDiffTime and UTCTime. This broke my code, which had manually
defined instances for these types, as they were needed. Things got
complicated, as only time's minor version number got incremented
(x.x.x.Y) . Cabal can't test against that version number.
I wanted my code to work with old and new versions of GHC. Since
testing against the version of time was impossible, I did the next best
thing: tested against the version of GHC.
#if __GLASGOW_HASKELL__ >= 610
-- instances added in GHC 6.10.3
instance Typeable NominalDiffTime where
typeOf _ = mkTypeName "NominalDiffTime"
instance Typeable UTCTime where
typeOf _ = mkTypeName "UTCTime"
Also, in the .cabal, there is a build-depends on time>=22.214.171.124.
Now, that would break for GHC 6.10.1 and 6.10.2 users, but will work for
6.10.3 and above, or 6.8 and below. Or so I thought.
Now I'm getting complaints from people using 6.10.4 saying that there
are now missing instances of Typeable with time 126.96.36.199.
1) Did the Typeable instances get dropped again from time?
2) What exactly should I do so this library compiles on GHC 6.8 and 6.10.x?
I'm looking at the darcs repo for time and don't see the instances ever
.... later addendum ....
so it appears that what's happening here is that GHC 6.10.3 extralibs
included time 1.1.3, but then haskell-platform standardized on 188.8.131.52.
This is pretty annoying -- that haskell-platform would standardize on a
version older than what shipped with a GHC release -- but I guess I can
work around it by restricting my build-dep to be time < 1.1.3 and
re-adding the instances.
Does this sound right?
> On Tue, Oct 13, 2009 at 2:51 AM, John Goerzen <jgoerzen at complete.org
> <mailto:jgoerzen at complete.org>> wrote:
> Hugo Gomes wrote:
> > Hi,
> > convertible and hdbc packages fail to compile in my standard
> > of the haskell platform. I think this has to do with those "if ghc >=
> > 610" macros on the typeable instances for some datatypes. I
> removed them
> > and now they work fine...
> What version of GHC and time do you have?
> -- John
More information about the Haskell-Cafe