Two minor reports concerning GHC

Simon Marlow simonmar@microsoft.com
Thu, 29 May 2003 15:47:16 +0100


=20
> (1) unhelpful error message from GHCi:
>=20
> [[
> Compiling ParsecPrim       ( F:\Haskell\Lib/ParsecPrim.hs,=20
> interpreted )
> WARNING: ignoring polymorphic case in interpreted mode.
>     Possibly due to strict polymorphic/functional constructor args.
>     Your program may leak space unexpectedly.
> ]]
> I don't understand what this is trying to say, and the lack=20
> of a source=20
> code line number doesn't give me any chance to study the code for=20
> clues.  This warning is GHCi only.

It is warning you about a bug in GHC.  Fortunately, the bug has been
fixed in the forthcoming 6.0 release.

> (2) Strange behaviour of GHCs Time.diffClockTimes function:
>=20
> This code fragment:
> [[
> runTest t =3D
>      do  { st <- Time.getClockTime
>          ; putStr $ "Test started:  "++show st++"\n"
>          ; runTestTT t
>          ; ft <- Time.getClockTime
>          ; putStr $ "Test finished: "++show ft++"\n"
>          ; let et =3D Time.diffClockTimes ft st
>          ; putStr $ "Test duration: "++show et++"\n"
>          }
> ]]
>=20
> yields this output:
> [[
> Test duration: TimeDiff {tdYear =3D 0, tdMonth =3D 0, tdDay =3D 0,=20
> tdHour =3D 0,=20
> tdMin =3D 0, tdSec =3D 9, tdPicosec =3D -437000000000}
> ]]

This is reasonable, as far as I can tell.  The only requirement on a
TimeDiff is that:

  t1 `addToClockTime` (t1 `diffClockTimes` t2) =3D=3D t2

and the TimeDiff above does just that.  It *could* be normalised so that
the signs of the two components are the same, but the current
implementation doesn't do that.

Cheers,
	Simon