Three patches for cabal

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Jun 17 05:24:48 EDT 2009


On Wed, 2009-06-03 at 16:41 +0200, Niklas Broberg wrote:

> Second there's the constructor NoMonoPatBinds, which actually
> describes the default Haskell 98 behavior, even if GHC has a different
> default. It's GHC's behavior that is the extension, so the constructor
> in cabal should really be named MonoPatBinds.
> 
> Also, the PatternSignatures constructor has been deprecated in GHC and
> superceded by ScopedTypeVariables.
> 
> The attached patches (three in one file) adds the proposed new
> constructors, deprecates the old ones, and adds documentation.

Can someone please comment on these two proposed changes. I agree with
Niklas but I'm a bit reluctant to apply the patches without at least
some sign of agreement from someone else.

Deprecating PatternSignatures seems uncontroversial, but the
NoMonoPatBinds is potentially controversial. GHC essentially uses
-XMonoPatBinds by default, even in H98 mode, and the user can use
-XNoMonoPatBinds to restore H98 behaviour. Niklas's and my point is that
the list of language extensions in Language.Haskell.Exceptions are
differences from H98 so it should be MonoPatBinds to get the difference
not NoMonoPatBinds to restore H98.

In practise, since ghc uses MonoPatBinds by default it'd mean that
people who want to get back to H98 would need to use:

  ghc-options: -XNoMonoPatBinds

Because the extensions field is additive, not subtractive. Using the
name MonoPatBinds allows other compilers to implement it without it
having to be the default.

Duncan



More information about the Glasgow-haskell-users mailing list