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

Weird NonEmpty error building with GHC 9.2.1 #2

Closed
locallycompact opened this issue Jan 5, 2022 · 4 comments
Closed

Weird NonEmpty error building with GHC 9.2.1 #2

locallycompact opened this issue Jan 5, 2022 · 4 comments

Comments

@locallycompact
Copy link

I'm using an out of tree relude from here kowainik/relude#387 for ghc 9.2.1 not sure where this error is coming from.

[16 of 16] Compiling Paths_polysemy_time ( dist/build/autogen/Paths_polysemy_time.hs, dist/build/Paths_polysemy_time.o, dist/b>

dist/build/autogen/Paths_polysemy_time.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
   |                      ^^^^
@aveltras
Copy link

aveltras commented Jan 5, 2022

I encounter the same error with ghc 8.10.7 using stackage lts 18.21.

@tek
Copy link
Owner

tek commented Jan 5, 2022

if I recall correctly, this was a temporary bug in cabal, fixed by haskell/cabal#7650

@tek
Copy link
Owner

tek commented Feb 4, 2022

@locallycompact could you resolve this?

@tek
Copy link
Owner

tek commented Feb 24, 2022

@locallycompact @aveltras this issue should be fixed in the newest versions of all my packages!

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

No branches or pull requests

3 participants