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

Function "readFileText" deprecated in relude 1.1 #573

Open
Vekhir opened this issue Sep 12, 2023 · 0 comments
Open

Function "readFileText" deprecated in relude 1.1 #573

Vekhir opened this issue Sep 12, 2023 · 0 comments

Comments

@Vekhir
Copy link

Vekhir commented Sep 12, 2023

When building summoner using relude 1.2.0.0, the following warning occurs:

[11 of 23] Compiling Summoner.Source

src/Summoner/Source.hs:92:35: warning: [-Wdeprecations]
    In the use of ‘readFileText’
    (imported from Prelude, but defined in relude-1.2.0.0:Relude.File):
    "'readFileText' depends on the system's locale settings and can throw unexpected exceptions.
     Use 'readFileBS' instead."
   |
92 |     Local path -> catch (Just <$> readFileText path) (localError path)
   |                                   ^^^^^^^^^^^^

The relude Changelog mentions this change in v1.1.0.0 and also suggests a fix:

Use readFileBS / readFileLBS instead to convert to Text / LText / String using decodeUtf8 and similar functions.

With that change, the supported version for relude can be bumped to 1.2.0.0

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

1 participant