Nothing Special   »   [go: up one dir, main page]

Skip to content
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

Generate warning-free Haskell code #331

Closed
8 of 9 tasks
andreasabel opened this issue Jan 8, 2021 · 4 comments
Closed
8 of 9 tasks

Generate warning-free Haskell code #331

andreasabel opened this issue Jan 8, 2021 · 4 comments
Assignees
Labels
enhancement Haskell xml Concerning the generated XML printers
Milestone

Comments

@andreasabel
Copy link
Member
andreasabel commented Jan 8, 2021

Recover the property of BNFC 2.7.1 to generate warning-free Haskell code
https://github.com/BNFC/bnfc/blame/0ad87322fce4cfe309512fa9fd56a63a06ff9c19/source/CHANGELOG.md#L117

andreasabel added a commit that referenced this issue Jan 31, 2021
andreasabel added a commit that referenced this issue Jan 31, 2021
andreasabel added a commit that referenced this issue Feb 13, 2021
- removed unused import
- blanked out unused function arguments
- added type signatures

TODO: some imports are still sometimes unused
andreasabel added a commit that referenced this issue Feb 13, 2021
Some warnings are disabled in the generated files.
andreasabel added a commit that referenced this issue Feb 13, 2021
andreasabel added a commit that referenced this issue Feb 14, 2021
The generated Test.hs file lacks imports, regressions introduced by
work on #331 and #278.
@andreasabel
Copy link
Member Author

89e5914 breaks compilation with GHC 7.10:

$ cabal build -w ghc-7.10.3
...
HierMod/Skel.hs:3:16:
    unknown flag in  {-# OPTIONS_GHC #-} pragma: -Wno-unused-matches

andreasabel added a commit that referenced this issue Feb 18, 2021
- DeriveTraversable implies DeriveFunctor and DeriveFoldable
- FlexibleInstances implies TypeSynonymInstances

Also fix a "Redundant $" hlint hint.
@andreasabel andreasabel self-assigned this Feb 27, 2021
@andreasabel andreasabel added this to the 2.9.1 milestone Feb 27, 2021
@andreasabel
Copy link
Member Author

Seems like the default test cases for XML and Haskell/GADT are now warning-free (testsuite passes).

andreasabel added a commit that referenced this issue Mar 3, 2021
This import is only needed if we have Ident-like tokens types.
@andreasabel
Copy link
Member Author
andreasabel commented Mar 6, 2021

There is a warning in Haskell/GADT with ghc 9.0:

ghc -XNoImplicitPrelude -Wall -Werror TestTest
[1 of 8] Compiling ComposOp         ( ComposOp.hs, ComposOp.o )
[2 of 8] Compiling AbsTest          ( AbsTest.hs, AbsTest.o )

AbsTest.hs:23:21: error: [-Wstar-is-type, -Werror=star-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.
   |
23 | data Tree :: Tag -> * where

Dropping GHC 7.10, we could assume base-4.9 and use Data.Kind.Type instead of *.
The StarIsType extension exists only since GHC 8.6 and is, while on by default, deprecated, to move away from * for Type.

@andreasabel andreasabel reopened this Mar 6, 2021
@andreasabel andreasabel added xml Concerning the generated XML printers and removed Haskell/GADT labels Mar 7, 2021
@andreasabel
Copy link
Member Author

Haskell-GADT moved to issue #346.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Haskell xml Concerning the generated XML printers
Projects
None yet
Development

No branches or pull requests

1 participant