[Haskell-cafe] Re: Allowing hyphens in identifiers

Colin Adams colinpauladams at googlemail.com
Wed Dec 16 09:30:52 EST 2009

2009/12/16 Duncan Coutts <duncan.coutts at googlemail.com>:
> On Wed, 2009-12-16 at 14:12 +0000, Colin Paul Adams wrote:
>> I don't think it's practical to edit all the .cabal packages as they
>> come in to say:
>>     ghc-options: -F -pgmF hspp
>> and cabal install does not recognize this line if I add to to my
>> ~/.cabal/config file.
>> Duncan, is there a way this can be done?
> I hope not! :-)
> If you want to view API docs in this alternate style then the right
> place to insert your hack is in haddock. You can then build all your
> packages with --haddock-options=--transform_to_underscore_style.

Yes, I understand that.

I was actually talking about the reverse transformation.
Richad O'Keefe has written a pre-processor (hspp) that will translate
underscore (or hyphen) style to camelCase.

By putting the above line in my project's .cabal file, it worked only
up to a point.
the point where it broke is because I was using ok_url from
Network.URL. my use of it was getting translated to okURL, which
causes a compile failure.
So I could fix this failure by unpacking Network.URL, editing it's
.cabal file to add the above line, and re-installing it.. But this is
likely to trickle through all the packages I have installed.

So I was looking for a way to make it the default. But I guess this
won't scale (if a package already has a pgmF preprocessot, there would
be a conflict).
Colin Adams

More information about the Haskell-Cafe mailing list