gregwebs/Shelly.hs

`shelly` unbuildable with GHC 8.0.2+

Closed this issue · 9 comments

hvr commented

It turns out that GHC 8.0.2 is a bit more strict re Haskell2010, and now rejects a default (Text) declaration more eagerly (rather than lazily as it did before):

src/Shelly/Pipe.hs:122:1-16: error:
    • The default type ‘Text’ is not an instance of ‘Num’
    • When checking the types in a default declaration

There's two ways to fix this in src/Shelly/Pipe.hs, by either

  • removing the redundant default (Text) declaration, or
  • adding a {-# LANGUAGE ExtendedDefaultRules #-} pragma

I just noticed this too. (It might be nice to make a note of this in the GHC 8.0.2 release notes...)

On a related topic, do you know why the error message mentions Num? Or why enabling ExtendedDefaultRules fixes it?

For the record, Ryan's note will be present in the 8.0.2 release notes.

For the record, Ryan's note will be present in the 8.0.2 release notes.

@bgamari: Wait, what? :)

I don't think we've addressed this particular regression yet—primarily because I don't even understand what's changed between 8.0.1 and 8.0.2 to make this issue appear. It would be mighty helpful if someone answer a subset of these questions:

  1. Why do we need to enable ExtendedDefaultRules in 8.0.2 but not 8.0.1 (and moreover, if you can point to a GHC commit in which this behavior changed)?
  2. Why is the error message is mentioning Num in the first place?

Admittedly, this appears to be a very much a corner case, as this is the only package where I encountered this particular class of error. But it'd be nice to document nonetheless.

Oops! I mixed up this with GHC #12881. Sorry about that!

I figured out the commit that caused this - see GHC Trac #12907.

hvr commented

@RyanGlScott as I explained in the GHC ticket, the particular code GHC refuses to compile is in fact illegal under (plain) Haskell2010.

hvr commented

Fwiw, #137 would be nice to have for GHC 8.0.2 as well (but it's not as critical)

Any chance of a release fixing this ? darcsden test suite uses shelly.

hvr commented

It looks to me like today's shelly-1.6.8.2 and shelly-1.6.8.3 releases (which btw are identical, except for the version number) address the problem at hand, so I'm considering this ticket closed as far as I'm concerned.