Non-H98 crusade, contd.

Jan-Willem Maessen jmaessen at
Sun Feb 27 11:53:54 EST 2005

On Feb 26, 2005, at 11:02 AM, Sven Panne wrote:
> ross at wrote:
>> 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. [...]
> OK, then let's reformulate my question: Why do we have a non-H98 ReadP 
> at all?

My view:

The existential types ensure that the continuation is used correctly.  
That's a pretty good reason to use them (rather than an extra type 
parameter) during development.  Once there's a working library, why 
make changes?

This is true of an awful lot of libraries which use existential types, 
by the way.  We could add extra witness type parameters, and the code 
would work without modification.  Some libraries even use a closed set 
of types existentially, permitting them to be eliminated completely.  
All those libraries then become H98 as if by magic.  The problem?  
Clunkier types, fewer guarantees, lots of opportunities to introduce 

That said, I'd love to see more H98 versions of non-H98 libraries.  
Often a bit of thought can eliminate gratuitous use of a language 
feature which seemed important during development.

-Jan-Willem Maessen

More information about the Libraries mailing list