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

Document that mixins doesn't work with stack repl #328

Closed
rikvdkleij opened this issue Aug 29, 2020 · 6 comments · Fixed by #329
Closed

Document that mixins doesn't work with stack repl #328

rikvdkleij opened this issue Aug 29, 2020 · 6 comments · Fixed by #329
Assignees
Labels
doc README, Haddock documentation, tutorials question Further information is requested

Comments

@rikvdkleij
Copy link

Following those instructions https://kowainik.github.io/projects/relude#mixins (also via summoner with Relude as alternative Prelude) Relude becomes not the default Prelude.

For some reason the GHC Prelude is not overridden/replaced by Relude.

@rikvdkleij
Copy link
Author

I'm using macOS and stack 2.3.3

@chshersh
Copy link
Contributor

Hi @rikvdkleij, could you provide a minimal example and your specific error? Most likely this is a Stack issue.

@chshersh chshersh added the question Further information is requested label Aug 30, 2020
@rikvdkleij
Copy link
Author

rikvdkleij commented Aug 30, 2020

I have created the project with summoner cli by entering relude as alternative prelude.
The generated Cabal file looks okay:

common common-options
  build-depends:       base ^>= 4.13.0.0
                     , relude
  
  mixins:              base hiding (Prelude)
                     , relude (Relude as Prelude)
  
  ghc-options:         -Wall
                       -Wcompat
                       -Widentities
                       -Wincomplete-uni-patterns
                       -Wincomplete-record-updates
  if impl(ghc >= 8.0)
    ghc-options:       -Wredundant-constraints
  if impl(ghc >= 8.2)
    ghc-options:       -fhide-source-paths
  if impl(ghc >= 8.4)
    ghc-options:       -Wmissing-export-lists
                       -Wpartial-fields
  if impl(ghc >= 8.8)
    ghc-options:       -Wmissing-deriving-strategies

  default-language:    Haskell2010
  default-extensions:  OverloadedStrings

library
  import:              common-options
  hs-source-dirs:      src
  exposed-modules:     Testrelude

And when I created a module which imports nothing and I want to use e.g. NonEmpty GHC says that's not in scope.

When I import Relude explicitly in module then GHC can find NonEmptyList but GHC gives error on e.g. putStrLn because of ambiguous occurences.

@vrom911
Copy link
Member

vrom911 commented Aug 30, 2020

I believe that you are encountering this Stack issue: commercialhaskell/stack#5077

If it is not the case, please provide some more details on how you build the project when you get the error (it would be nice to see module as well and the command with the output 🙂 ).

@rikvdkleij
Copy link
Author

Thanks, yes, it's the same issue. Maybe you can put a note in the documentation that the recommended way doesn't work (yet) with stack.

@vrom911 vrom911 reopened this Aug 30, 2020
@vrom911
Copy link
Member

vrom911 commented Aug 30, 2020

Nice idea! I will add it into troubleshooting section of the README.

@vrom911 vrom911 changed the title Recommended way of using Relude does not work Document that mixins doesn't work with stack repl Aug 30, 2020
@vrom911 vrom911 self-assigned this Aug 30, 2020
@vrom911 vrom911 added the doc README, Haddock documentation, tutorials label Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc README, Haddock documentation, tutorials question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants