noinia / hgeometry

HGeometry is a library for computing with geometric objects in Haskell. It defines basic geometric types and primitives, and it implements some geometric data structures and algorithms.
122 stars 41 forks source link

Build fails on latest Hackage version #221

Closed walseb closed 2 months ago

walseb commented 1 year ago

HI! When I build this using the latest Hackage version and GHC 9.2.4, my build fails. Here's the log:

Configuring library for hgeometry-0.11.0.0..
Preprocessing library for hgeometry-0.11.0.0..
Building library for hgeometry-0.11.0.0..
[  1 of 105] Compiling Algorithms.Geometry.SoS.Expr ( src/Algorithms/Geometry/SoS/Expr.hs, dist/build/Algorithms/Geometry/SoS/Expr.o, dist/build/Algorithms/Geometry/SoS/Expr.dyn_o )

src/Algorithms/Geometry/SoS/Expr.hs:6:1: warning: [-Wunused-imports]
    The import of ‘Data.List.NonEmpty’ is redundant
      except perhaps to import instances from ‘Data.List.NonEmpty’
    To import instances alone, use: import Data.List.NonEmpty()
  |
6 | import           Data.List.NonEmpty (NonEmpty(..),nonEmpty)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Algorithms/Geometry/SoS/Expr.hs:37:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘abs’ and ‘signum’
    • In the instance declaration for ‘Num (Expr i r)’
   |
37 | instance (Num r) => Num (Expr i r) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^
[  2 of 105] Compiling Algorithms.Geometry.SoS.Sign ( src/Algorithms/Geometry/SoS/Sign.hs, dist/build/Algorithms/Geometry/SoS/Sign.o, dist/build/Algorithms/Geometry/SoS/Sign.dyn_o )
[  3 of 105] Compiling Algorithms.Geometry.SoS.Symbolic ( src/Algorithms/Geometry/SoS/Symbolic.hs, dist/build/Algorithms/Geometry/SoS/Symbolic.o, dist/build/Algorithms/Geometry/SoS/Symbolic.dyn_o )

src/Algorithms/Geometry/SoS/Symbolic.hs:24:1: warning: [-Wunused-imports]
    The import of ‘Data.Word’ is redundant
      except perhaps to import instances from ‘Data.Word’
    To import instances alone, use: import Data.Word()
   |
24 | import           Data.Word
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Algorithms/Geometry/SoS/Symbolic.hs:25:58: warning: [-Wunused-imports]
    The import of ‘suchThat’ from module ‘Test.QuickCheck’ is redundant
   |
25 | import           Test.QuickCheck (Arbitrary(..), listOf, suchThat)
   |                                                          ^^^^^^^^
[  4 of 105] Compiling Data.Geometry.Directions ( src/Data/Geometry/Directions.hs, dist/build/Data/Geometry/Directions.o, dist/build/Data/Geometry/Directions.dyn_o )
[  5 of 105] Compiling Data.Geometry.Interval.Util ( src/Data/Geometry/Interval/Util.hs, dist/build/Data/Geometry/Interval/Util.o, dist/build/Data/Geometry/Interval/Util.dyn_o )
[  6 of 105] Compiling Data.Geometry.Properties ( src/Data/Geometry/Properties.hs, dist/build/Data/Geometry/Properties.o, dist/build/Data/Geometry/Properties.dyn_o )

src/Data/Geometry/Properties.hs:32:26: warning: [-Wstar-is-type]
    Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
    relies on the StarIsType extension, which will become
    deprecated in the future.
    Suggested fix: use ‘Type’ from ‘Data.Kind’ instead.
   |
32 | type family NumType t :: *
   |                          ^
[  7 of 105] Compiling Data.Geometry.Interval ( src/Data/Geometry/Interval.hs, dist/build/Data/Geometry/Interval.o, dist/build/Data/Geometry/Interval.dyn_o )
[  8 of 105] Compiling Data.Geometry.IntervalTree ( src/Data/Geometry/IntervalTree.hs, dist/build/Data/Geometry/IntervalTree.o, dist/build/Data/Geometry/IntervalTree.dyn_o )
[  9 of 105] Compiling Data.Geometry.RangeTree.Measure ( src/Data/Geometry/RangeTree/Measure.hs, dist/build/Data/Geometry/RangeTree/Measure.o, dist/build/Data/Geometry/RangeTree/Measure.dyn_o )

src/Data/Geometry/RangeTree/Measure.hs:48:10: error:
    Duplicate instance declarations:
      instance forall k (l :: k -> *) (a :: k) (r :: k -> *).
               (Semigroup (l a), Semigroup (r a)) =>
               Semigroup ((:*:) l r a)
        -- Defined at src/Data/Geometry/RangeTree/Measure.hs:48:10
      instance [safe] forall k (f :: k -> *) (a :: k) (g :: k -> *).
                      (Semigroup (f a), Semigroup (g a)) =>
                      Semigroup (Product f g a)
        -- Defined in ‘Data.Functor.Product’
   |
48 | instance (Semigroup (l a), Semigroup (r a)) => Semigroup ((l :*: r) a) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Geometry/RangeTree/Measure.hs:51:10: error:
    Duplicate instance declarations:
      instance forall k (l :: k -> *) (a :: k) (r :: k -> *).
               (Monoid (l a), Monoid (r a)) =>
               Monoid ((:*:) l r a)
        -- Defined at src/Data/Geometry/RangeTree/Measure.hs:51:10
      instance [safe] forall k (f :: k -> *) (a :: k) (g :: k -> *).
                      (Monoid (f a), Monoid (g a)) =>
                      Monoid (Product f g a)
        -- Defined in ‘Data.Functor.Product’
   |
51 | instance (Monoid (l a), Monoid (r a)) => Monoid ((l :*: r) a) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Thoughts?

Thanks for any help!

noinia commented 1 year ago

Your log states you are trying to compile hgeometry-0.11.0.0, whereas the latest version on hackage is actually 0.14. My guess is that 0.11 is simply not compatible with 9.2 Actually, even the latest version on version (0.14) is a bit outdated in comparison to what is on git. My recommendation would be to actually either just use the master branch from git here, or --if you are feeling adventurous-- the https://github.com/noinia/hgeometry/tree/hgeom1_again branch. The latter branch is mostly a rewrite of hgeometry that uses much more typeclasses, which allows us to use some faster data structures in places. I haven't ported everything to that new setup though.

walseb commented 1 year ago

Ah, I see.

Thank you!