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

Merge Prelude & Nix.Utils #985

Merged
merged 21 commits into from
Aug 21, 2021
Merged

Merge Prelude & Nix.Utils #985

merged 21 commits into from
Aug 21, 2021

Conversation

Anton-Latukha
Copy link
Collaborator

@Anton-Latukha Anton-Latukha commented Aug 14, 2021

We essentially had 2 preludes, now they are merged & allow to control what parts of relude are exposed.
It clean-up imports quite a bit & provides a set of frequently used functions.

relude is a pretty good prelude, but it still has flaws (for example it exposes a mix of Text & String functions, which is weird from the outside). If we want to use Text internally - that should be it, conversion can still be needed (for base ^ GHC reasons), but at least is would be only on the IO margins (which are prelude functions), not 2 conversions in the middle of data flow.

This setup helps to program with supplying Text type functions & support of stronger types.

There may be a specific thing - currently, it is probably tricky to import our Prelude module into other projects, that can be addressed by moving stuff back into Nix.Utils & passing it through Prelude module, but then people would start importing Nix.Utils from time to time in the code base, which is Ok, since because of Prelude passthrough - that would be rare.

I needed to do this sort of merge, to align all code & project this way properly, before I do further things with it.

This is the last thing I had in mind, I plan to stop refactors any moment if #804 ever continues.

It is used in ~50% of modules & looks a standard feature at this point.
This allows to achieve Zen of Text<->String & Path<->FilePath.

Set of functions for Text & Path now can be formed & exported.
This explicitly states the code smell of String use left.
@Anton-Latukha Anton-Latukha marked this pull request as ready for review August 14, 2021 16:09
After making this flexible prelude setup, we are moving the custom code back
into Nix.Utils, so the downstream projects do not have trouble importing Prelude
module, but just use regular Nix.Utils module.
@Anton-Latukha
Copy link
Collaborator Author

Now we have both the most flexible Prelude setup & the Nix.Utils that holds custom code, nice.

@Anton-Latukha Anton-Latukha merged commit 0fdd17b into master Aug 21, 2021
@Anton-Latukha Anton-Latukha deleted the 2021-08-13-upd branch August 21, 2021 16:02
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