diagrams / diagrams-contrib

User-contributed extensions to diagrams
BSD 3-Clause "New" or "Revised" License
27 stars 31 forks source link

Can't compile Diagrams/TwoD/Path/Follow.hs: No instance for Semigroup. #73

Closed kindaro closed 6 years ago

kindaro commented 6 years ago

Steps to reproduce:

% stack init
% stack build
% cabal sandbox init
% cabal install
% # Alright?

Expected:

The package diagrams-contrib 1.4.2 builds, either with stack or cabal sandbox, preferably with both.

Actual:

The following error (amidst a bunch of warnings):

src/Diagrams/TwoD/Path/Follow.hs:64:21: error:
    • No instance for (Semigroup (Semi (Trail' Line V2 n) (Angle n)))
        arising from the 'deriving' clause of a data type declaration
      Possible fix:
        use a standalone 'deriving instance' declaration,
          so you can specify the instance context yourself
    • When deriving the instance for (Semigroup (Following n))
   |
64 |   deriving (Monoid, Semigroup)
   |                     ^^^^^^^^^

-- Arises with either cabal sandbox or stack snapshot.

The stack snapshot chosen by stack init is lts-10.4.

Program versions:

% ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.2.2
% stack --version
Version 1.7.0, Git revision 2631803b9c502fa5225eac3536acda9d1d314aa7 (5619 commits) x86_64 hpack-0.20.0
% cabal --version
cabal-install version 2.0.0.1
compiled using version 2.0.1.1 of the Cabal library
% git log --oneline | head -n 1
c5617c7 specify cabal-version >= 1.18 for extra-doc-files
kindaro commented 6 years ago

Anyone here?

byorgey commented 6 years ago

Apologies! I am here, and this is definitely on my radar. I will try to address this tomorrow.

kindaro commented 6 years ago

@byorgey Thanks! Didn't mean to disturb you.

byorgey commented 6 years ago

@kindaro No, I appreciate the nudge! Please keep bothering me if I don't get it done today.

byorgey commented 6 years ago

Should be fixed now. A commit adding a Semigroup instance for GHC 8.4 compatibility (https://github.com/diagrams/diagrams-contrib/pull/71) was accidentally included in the 1.4.2 release, without a corresponding release of diagrams-lib with an added Semigroup instance that this one depends on (https://github.com/diagrams/diagrams-lib/pull/308). For now I just reverted that commit and released 1.4.2.1 without the offending Semigroup instance; I will re-add the instance once making a new release of diagrams-lib with GHC 8.4 compatibility.