Switch to relude; clean-up; some String -> Text migration work #890
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 tobase 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 theundefined
- those are not mine, they were there before for months 👐.Done basic integration clean-up after the migration.
The next patches as an effect of
relude
present,would clean-up and refactor the code.