Skip to content

Fixing the package to run with the latest stack lts version #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

charltonaustin
Copy link

No description provided.

Comment on lines +17 to +19
.stack-work/
stack.yaml.lock
*.swp
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't these patterns be better off in Stack users' global gitignore file?

What's *.swp?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for vim backup files. When you open a file in vim it creates a swp file so that if it crashes you don't lose the information.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to remove rather than add more ignored files in the project, relying more on users global gitignore files.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I can close this.

Copy link
Owner

@conal conal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

Do use do you get out of this library? It's pretty old and largely superceded.

@charltonaustin
Copy link
Author

Yeah actually I'm working out of the book Learn Physics With Functional Programming and it uses the library not-gloss which is dependent on this. Currently not-gloss and this are no longer available by default in stack. I'd be willing to do the leg work to get this supported by stack. I'm pretty new (6ish months) to Haskell so I have no idea what it takes though.

@charltonaustin
Copy link
Author

Also I should have said this above. Thanks for the library.

@charltonaustin charltonaustin requested a review from conal January 30, 2025 21:48
@conal
Copy link
Owner

conal commented Feb 2, 2025

Yeah actually I'm working out of the book Learn Physics With Functional Programming and it uses the library not-gloss which is dependent on this. Currently not-gloss and this are no longer available by default in stack. ...

Thanks for the motivation and info.

Copy link
Owner

@conal conal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"stack build" fails for me with the stack.yaml change.

@charltonaustin
Copy link
Author

What is the error?
Here's the output of my command:

$ stack clean && stack build
TypeCompose-0.9.14: unregistering (local file changes: TypeCompose.cabal src/Control/Compose.hs src/Control/Instances.hs src/Data/Bijection.hs src/Data/...)
TypeCompose> configure (lib)
Configuring TypeCompose-0.9.14...
TypeCompose> build (lib) with ghc-9.8.4
Preprocessing library for TypeCompose-0.9.14..
Building library for TypeCompose-0.9.14..
[ 1 of 10] Compiling Control.Instances
[ 2 of 10] Compiling Data.Bijection
[ 3 of 10] Compiling Control.Compose

/TypeCompose/src/Control/Compose.hs:221:22: warning: [GHC-39567] [-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.
    |
221 | newtype ((g :: k2 -> *) :. (f :: k1 -> k2)) (a :: k1)
    |                      ^

/TypeCompose/src/Control/Compose.hs:748:10: warning: [GHC-62412] [-Wsimplifiable-class-constraints]
    • The constraint ‘Show (f a, g a)’ matches
        instance (Show a, Show b) => Show (a, b) -- Defined in ‘GHC.Show’
      This makes type inference for inner bindings fragile;
        either use MonoLocalBinds, or simplify it using the instance
    • In the instance declaration for ‘Show ((f :*: g) a)’
    |
748 | instance (Show (f a, g a)) => Show ((f :*: g) a) where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/TypeCompose/src/Control/Compose.hs:751:10: warning: [GHC-62412] [-Wsimplifiable-class-constraints]
    • The constraint ‘Eq (f a, g a)’ matches
        instance (Eq a, Eq b) => Eq (a, b)
          -- Defined in ‘ghc-prim-0.11.0:GHC.Classes’
      This makes type inference for inner bindings fragile;
        either use MonoLocalBinds, or simplify it using the instance
    • In the instance declaration for ‘Eq ((f :*: g) a)’
    |
751 | instance (Eq (f a, g a)) => Eq ((f :*: g) a) where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/TypeCompose/src/Control/Compose.hs:754:10: warning: [GHC-62412] [-Wsimplifiable-class-constraints]
    • The constraint ‘Ord (f a, g a)’ matches
        instance (Ord a, Ord b) => Ord (a, b)
          -- Defined in ‘ghc-prim-0.11.0:GHC.Classes’
      This makes type inference for inner bindings fragile;
        either use MonoLocalBinds, or simplify it using the instance
    • In the instance declaration for ‘Ord ((f :*: g) a)’
    |
754 | instance (Ord (f a, g a)) => Ord ((f :*: g) a) where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 4 of 10] Compiling Data.Lambda
[ 5 of 10] Compiling Data.Pair
[ 6 of 10] Compiling Data.RefMonad
[ 7 of 10] Compiling Data.Title
[ 8 of 10] Compiling Data.CxMonoid

/TypeCompose/src/Data/CxMonoid.hs:18:1: warning: [GHC-66111] [-Wunused-imports]
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()
   |
18 | import Data.Monoid (Monoid(..))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 9 of 10] Compiling Data.Zip
[10 of 10] Compiling Data.Partial
TypeCompose> copy/register
Installing library in /TypeCompose/.stack-work/install/aarch64-osx/4420f36605625fdf3199d673f20db5d8e298e537183aaea43fbbd8a22bbf1d1b/9.8.4/lib/aarch64-osx-ghc-9.8.4/TypeCompose-0.9.14-Hd2maZdrStEHTJCOqm5FuB
Registering library for TypeCompose-0.9.14..

Also I'm on

$ stack --version
Version 3.1.1, Git revision d8cef4ea052430ea09ce7836c41e68b52d04fd73 aarch64 hpack-0.37.0

@conal
Copy link
Owner

conal commented Feb 3, 2025

What is the error?
Here's the output of my command:

Thanks. I saw these same warnings and thought they were errors.

Does Stack really need a library's resolver to be updated in order to include the library in newer LTS versions?

@charltonaustin
Copy link
Author

Maybe not? I just know that when I tried to build it locally using stack there wasn't a compiler version that was available for my system. So I just went ahead and updated. Here's the output from the build using lts-9.20:

$ stack clean && stack build

Error: [S-9443]
       No setup information found for ghc-8.0.2 on your platform. This probably means a GHC binary distribution has not yet been added for OS key macosx-aarch64. Supported versions: ghc-8.10.5,
       ghc-8.10.6, ghc-8.10.7, ghc-9.0.2, ghc-9.2.1, ghc-9.2.2, ghc-9.2.3, ghc-9.2.4, ghc-9.2.5, ghc-9.2.6, ghc-9.2.7, ghc-9.2.8, ghc-9.4.1, ghc-9.4.2, ghc-9.4.3, ghc-9.4.4, ghc-9.4.5, ghc-9.4.6,
       ghc-9.4.7, ghc-9.4.8, ghc-9.6.1, ghc-9.6.2, ghc-9.6.3, ghc-9.6.4, ghc-9.6.5, ghc-9.6.6, ghc-9.8.1, ghc-9.8.2, ghc-9.8.3, ghc-9.8.4, ghc-9.10.1 and ghc-9.12.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants