plaidfinch / ComonadSheet

A library for expressing "spreadsheet-like" computations with absolute and relative references, using fixed-points of n-dimensional comonads.
MIT License
155 stars 11 forks source link

Building on ghc 7.10: "Not in scope : [...] 'NestedCount'" #5

Open gatlin opened 9 years ago

gatlin commented 9 years ago

Just for kicks I updated ghc to 7.10 and base to 4.8. Possibly for good reason, ComonadSheet, Tape, IndexedList, and NestedFunctor had build-depends restrictions ">= 4.7 && < 4.8". I changed them and everything but ComonadSheet builds fine manually. I've made sure that they were installed globally, etc, and that I can include them in other code in other projects.

However, when building ComonadSheet, I get the following output. Short version is NestedCount isn't visible where it should be.

I'm hunting for where NestedCount is defined and will submit a pull request or two if it all goes well.

Details: OS X 10.10, ghc 7.10.1.

plaidfinch commented 9 years ago

That is bizarre; thank you for bringing this to my attention. (Also, I still owe you an email — coming up as soon as I defend my thesis, I promise!)

NestedCount and NestedNTimes live in Data.Functor.Nested, which indeed has not been updated for GHC 7.10.

But, I think I know where your error is coming from! I rearranged where these type families live, and I think they've gotten lost in the shuffle! The version of NestedFunctor which lives on GitHub should now contain these changes, and the version of ComonadSheet on GitHub should now not contain these functions.

I don't have time to test this right now, but I'll get back to it shortly.

ysangkok commented 3 years ago

It compiles fine and the glider works fine on GHC 8.10.4 if I just fix the naming in DimensionalAs. I can send a PR if you would merge it @kwf . I didn't have any issue with NestedCount.

plaidfinch commented 3 years ago

Wow, it's been a long time since I've thought about this project! I would gladly merge a PR that brought its dependency bounds back up to date. If I may ask, how did you come to be playing around with it?

ysangkok commented 3 years ago

The talk was recommended to me by the YouTube algorithm. :)

To get this package to build, the dependencies need to have their versions relaxed. I just removed the upper bounds, and since that method worked so many years after the version was released, I think it is a good approach (in contrast to setting new upper bounds that would need revising). I think it is unlikely that new versions of the dependencies will break the usage here, since they haven't done it in the last 6 years. This approach also means that no new version needs to be released, since the version bounds can be relaxed using Hackage revisions.

For IndexedList:

--- a/IndexedList.cabal
+++ b/IndexedList.cabal
@@ -20,6 +20,6 @@ library
   exposed-modules:     Data.List.Indexed, Data.List.Indexed.Conic, Data.List.Indexed.Counted
   -- other-modules:       
   other-extensions:    RankNTypes, GADTs, PolyKinds, ConstraintKinds, DataKinds, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeOperators
-  build-depends:       base >=4.7 && <4.8, PeanoWitnesses >= 0.1
+  build-depends:       base >=4.7, PeanoWitnesses >= 0.1
   -- hs-source-dirs:      
   default-language:    Haskell2010

For NestedFunctor:

--- a/NestedFunctor.cabal
+++ b/NestedFunctor.cabal
@@ -20,6 +20,6 @@ library
   exposed-modules:     Data.Functor.Nested
   -- other-modules:       
   other-extensions:    ConstraintKinds, FlexibleInstances, GADTs, MultiParamTypeClasses, PolyKinds, RankNTypes, StandaloneDeriving, TypeFamilies, TypeOperators, UndecidableInstances
-  build-depends:       base >=4.7 && <4.8, comonad >=4.2 && <4.3, distributive >=0.4 && <0.5, PeanoWitnesses >= 0.1
+  build-depends:       base >=4.7, comonad >=4.2, distributive >=0.4, PeanoWitnesses >= 0.1
   -- hs-source-dirs:      
   default-language:    Haskell2010

For PeanoWitnesses:

--- a/PeanoWitnesses.cabal
+++ b/PeanoWitnesses.cabal
@@ -19,6 +19,6 @@ library
   exposed-modules:     Data.Numeric.Witness.Peano
   -- other-modules:       
   other-extensions:    ConstraintKinds, DataKinds, FlexibleContexts, FlexibleInstances, GADTs, ScopedTypeVariables, StandaloneDeriving, TypeFamilies, TypeOperators
-  build-depends:       base >=4.7 && <4.8
+  build-depends:       base >=4.7
   -- hs-source-dirs:      
   default-language:    Haskell2010

For Tape:

--- a/Tape.cabal
+++ b/Tape.cabal
@@ -20,6 +20,6 @@ library
   exposed-modules:     Data.Stream.Tape
   -- other-modules:       
   other-extensions:    DeriveFunctor, FlexibleInstances
-  build-depends:       base >=4.7 && <4.8, comonad >=4.2 && <4.3, distributive >=0.4 && <0.5, Stream >=0.4 && <0.5
+  build-depends:       base >=4.7, comonad >=4.2, distributive >=0.4, Stream >=0.4
   -- hs-source-dirs:      
   default-language:    Haskell2010

I have sent PR #8 separately which relaxes the version bounds for this package. That PR also contains a code change which is necessary for it to build.