Non-H98 crusade, contd.

ross at ross at
Fri Feb 25 19:46:19 EST 2005

On Fri, Feb 25, 2005 at 11:46:42PM +0100, Sven Panne wrote:
> Apart from the recent Monoid problems, I'm a bit concerned about the
> non-portable ReadP creeping into some modules, making them non-H98. This
> affects e.g.  Cabal and even something as simple as System.Info
> (which incorrectly claims that is portable).  IMHO we should really
> keep at least those portable, even if this would involve a little bit
> more work. Is local universal quantification really needed for those
> simple parsing tasks? It looks a bit like overkill here...

Cabal has lots of compatibility gunk to preserve portability.  It uses
Distribution.Compat.ReadP, which presents a Haskell 98 interface,
implemented using Text.ParserCombinators.ReadP for those that have it and
re-implemented for the rest.  So even though it's forcing a -98 in Hugs,
it is portable, i.e. offered by every system with the same interface.

Data.Version, on the other hand, has a compiler-dependent interface:

#if __GLASGOW_HASKELL__ >= 603 || __HUGS__
parseVersion :: ReadP Version
#elif __NHC__
parseVersion :: ReadPN r Version
parseVersion :: ReadP r Version

System.Info imports that, but also presents a Haskell 98 interface.

More information about the Libraries mailing list