Hello. some questions and suggestions

Ross Paterson ross at soi.city.ac.uk
Thu Dec 28 09:40:52 EST 2006


On Thu, Dec 28, 2006 at 01:54:51AM +0000, Duncan Coutts wrote:
> On Thu, 2006-12-28 at 01:06 +0000, Ross Paterson wrote:
> > On Thu, Dec 28, 2006 at 12:37:07AM +0000, Duncan Coutts wrote:
> > > The issue was that hugs's version of ReadP needed -98 and Cabal's
> > > 'compat' version didn't, so I just changed the ifdefs so that hugs
> > > always uses the compat implementation rather than it's own.
> > 
> > But this means that under Hugs (but not GHC) the parse functions exported
> > by Cabal can only be used with Distribution.Compat.ReadP, and can't be
> > combined with real ReadP parsers.
> 
> Yes, I that's true. Was that a requirement?
>
> We have the same issue for older ghc versions. Perhaps a longer term
> solution might be to make hugs's ReadP not need -98. Does it have
> something extra compared to the Cabal version that really needs non-H98
> extensions?

Source-level compatibility is a major objective for Hugs.  Having Hugs
use a different version of ReadP from GHC would be a step away from
that, unless GHC does the same, and that would be inelegant.

ReadP is a kind of continuation monad.  It's polymorphic in the result of
the continuation, and using a polymorphic component is the neatest way to
express that, but of course it's not H98.  The Compat version is identical
to the real one, except that the ReadP type is also parameterized by
the continuation result type.  The local universal quantification isn't
necessary to make ReadP work, but it does make it neater.



More information about the cabal-devel mailing list