serokell / haskell-with-utf8

Get your IO right on the first try
https://serokell.io/blog/haskell-with-utf8
52 stars 3 forks source link

Make it build with ghc-9.8 #25

Closed erikd closed 8 months ago

erikd commented 10 months ago

Builds fine, but get a warning in the tests:

test/Test/Utf8/ReadWrite.hs:25:1: error: [GHC-45102]
    Ambiguous module name ‘Data.Text.IO.Utf8’.
    it was found in multiple packages: text-2.1 with-utf8-1.0.2.4
   |
25 | import qualified Data.Text.IO.Utf8 as Utf8
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SInce this is only a version bump, I would appreciate a Hackage metadata update.

gromakovsky commented 9 months ago

@erikd thanks, I've opened another PR to make some additional changes, in particular to test on CI: https://github.com/serokell/haskell-with-utf8/pull/27

Ambiguous module name ‘Data.Text.IO.Utf8’.

Yep, a module with this name was added in text-2.1, so this warning is expected. This module in witf-utf8 exports only two functions: readFile and writeFile. text's module exports the same functions with seemingly the same semantics (but different implementations), but with different types (they return IO while in with-utf8 they are polymorphic in the monad parameter). I think eventually this module should be removed, but we can start with deprecating it. However, in this case it won't be just a Hackage metadata update, it will require a new version.

SInce this is only a version bump, I would appreciate a Hackage metadata update.

We can make a metadata update, then deprecate the module and make a new version. However, I'm not sure if it's legal to make a package that exports module Data.Text.IO.Utf8 while its dependency also has module Data.Text.IO.Utf8. Do you know if that's allowed?

erikd commented 9 months ago

What you ask about my be possible with the PackageImportsextension but not sure.

gromakovsky commented 8 months ago

@erikd I have merged #27 and released version 1.1.0.0. Data.Text.IO.Utf8 is now deprecated, and test/Test/Utf8/ReadWrite.hs was updated to use PackageImports.

Builds fine, but get a warning in the tests:

I tried it locally, and it seems to be not a warning but an error.

SInce this is only a version bump, I would appreciate a Hackage metadata update.

I think a metadata update shouldn't be made in this case, because supporting text-2.1 requires code changes. Without code changes tests don't compile. So I've made a new release instead. I had to make a major version bump, because one module was deprecated.

gromakovsky commented 8 months ago

Closing due to #27