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

Switch to relude; clean-up; some String -> Text migration work #890

Merged
merged 6 commits into from
Mar 21, 2021

Conversation

Anton-Latukha
Copy link
Collaborator

@Anton-Latukha Anton-Latukha commented Mar 18, 2021

Relates to the discussion: #889 and the report: #897.

Wanted to practically look at how it is to switch the project, and how much it would help to organize textual data types in the project.
Results are very surprising, migration went just as official documentation stated and without hiccups, and easiness to switch things to Text started to reveal itself.
Migration to text, basic exception handling functions use Text - this alone should save a lot of RAM in runtime comparing to base prelude with String, since, as far as I know, some exception handling function get evaluated eagerly in place and stored in RAM - that I touched upon in our performance thread.

And migration is smooth. In one day managed to migrate the whole project.


There are many more improvements possible, more imports and qualified imports can be cleaned-up, and more String to Text can be switched, but these kind of processes are long multi-stage processes.

The prelude update went even without any type signature anywhere, so it has happened without API changes (so according to Haskell seems like there are no API changes), but of course it is safe to mention these type of change in the ChangeLog, and mention that something may start to return Text or NonEmpty if that happens. And I plan to go and myself help downstream projects with migration to future release anyway, since it is big, I suspect 2-3 projects we have downstream use if even 0.5-3% of our API, if not just parseNixFile/Text & normalForm.


Please note, that this is a draft, and this change makes many improvements possible to make in the code.

Migration went smooth, and relude forces builds to bark on the undefined - those are not mine, they were there before for months 👐.


  • ✔️ project already works.
  • ✔️ done backward compatibility for GHC 8.6.
  • ✔️ clean-up.

Done basic integration clean-up after the migration.

The next patches as an effect of relude present,would clean-up and refactor the code.

The type level code here is quite complex, to ease the work with it - lets
provide explicit type signatures.
@Anton-Latukha Anton-Latukha force-pushed the 2021-03-18-relude-the-string-into-text branch 3 times, most recently from 23435f7 to 5e25fc3 Compare March 21, 2021 16:05
Since the extention is made the default, lets clean-up the files.

It also can be a seen as a step towards GHC2021.
`relude` helps us to reduce a lot of technical debpt in the project.

Upstrem discussion:
#889
Please, enable it back after #896 closes.
@Anton-Latukha Anton-Latukha force-pushed the 2021-03-18-relude-the-string-into-text branch from 5e25fc3 to cd02c6d Compare March 21, 2021 16:47
@Anton-Latukha Anton-Latukha marked this pull request as ready for review March 21, 2021 17:12
@Anton-Latukha Anton-Latukha changed the title draft: tryout of the swtitch to relude, clean-up, String -> Text migration work Swtitch to relude; clean-up; some String -> Text migration work Mar 21, 2021
@Anton-Latukha Anton-Latukha merged commit 50e63f8 into master Mar 21, 2021
@Anton-Latukha Anton-Latukha deleted the 2021-03-18-relude-the-string-into-text branch March 21, 2021 22:31
@Anton-Latukha Anton-Latukha changed the title Swtitch to relude; clean-up; some String -> Text migration work Switch to relude; clean-up; some String -> Text migration work May 10, 2021
layus added a commit to layus/hnix that referenced this pull request Dec 17, 2021
layus added a commit to layus/hnix that referenced this pull request Dec 17, 2021
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

Successfully merging this pull request may close these issues.

1 participant