-
Notifications
You must be signed in to change notification settings - Fork 698
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
Generated Paths_ module conflicts with classy-prelude #5962
Comments
I wouldn't call this a bug. The |
We can easily fix it with an explicit import list. But yeah, it's more of an enhancement than a bug. |
We can, but we need still to document most assumptions
And these aren't even too far fetched changes. |
True. |
Related: #1170. |
Is there a good workaround for this? I'm using RIO as a prelude replacement and running into the same issue. The only obvious way I can see to fix for myself as of now is to |
#1170 looks like a harder problem, but given the assumption of a standard base, I think it's worthwhile progress if we can insulate ourselves from alternate preludes. This compiles for me, and I'd be happy to PR it if there's interest: {-# LANGUAGE NoImplicitPrelude #-}
-- ...
import qualified Control.Exception as Exception
import Control.Monad (return)
import Data.List ((++))
import Data.Version (Version(..))
import System.Environment (getEnv)
import System.IO as IO |
@rossabaker except it doesn't actually shield you from alternative preludes at all... this only helps if the remaining referenced modules in scope still conform to some implicit undocumented assumption. Also, we'd still need to version guard any such changes on Here's a different idea I've been toying with to address this problem in a more principled way: define a new package (say The |
I know this is an old issue, but when migrating from Cabal-3.4 to Cabal-3.6 and using relude: mixins: base hiding (Prelude)
, relude (Relude as Prelude
, Relude.Extra) which then generates an error when compiling the paths module because relude defines XXX/dist-newstyle/build/x86_64-osx/ghc-8.10.7/knit-haskell-0.10.1.0/build/autogen/Paths_knit_haskell.hs:66:22: error:
• 'last' works with 'NonEmpty', not ordinary lists.
Possible fix:
Replace: [Char]
With: NonEmpty Char
However, you can use 'last' with the ordinary lists.
Apply 'viaNonEmpty' function from relude:
viaNonEmpty last (yourList)
Note, that this will return 'Maybe Char'
therefore it is a safe function unlike 'last' from the standard Prelude
• In the first argument of ‘isPathSeparator’, namely ‘(last dir)’
In the expression: isPathSeparator (last dir)
In a stmt of a pattern guard for
an equation for ‘joinFileName’:
isPathSeparator (last dir)
|
66 | | isPathSeparator (last dir) = dir ++ fname
| ^^^^^^^^ Going back to 3.4 resolves this. Can someone explain how to work around this in more detail? Like what is meant by "We can easily fix it with an explicit import list"? Where would the explicit import list go? I can just go back to cabal 3.4 for now but that doesn't seem like a long-term solution. |
@adamConnerSax I think your issue already fixed in #7650, and cabal-install 3.6.2 will release in recent days #7671 |
I have the following common stanza:
Unfortunately, the autogenerated
Paths_
module conflicts withclassy-prelude
because they both definecatchIO
:The text was updated successfully, but these errors were encountered: