-
Notifications
You must be signed in to change notification settings - Fork 115
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Anton-Latukha
force-pushed
the
2021-08-13-upd
branch
from
August 14, 2021 15:14
695c686
to
21ac119
Compare
This explicitly states the code smell of String use left.
Anton-Latukha
force-pushed
the
2021-08-13-upd
branch
from
August 14, 2021 15:17
21ac119
to
49d91c7
Compare
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.
Now we have both the most flexible |
Moved function got some alteration. Reduced Lazy -> Strict marchalling. Also instead of Lazy used Strict data types, since on the conveyor that data seems to be consumed fully (which I may be wrong about).
Anton-Latukha
force-pushed
the
2021-08-13-upd
branch
from
August 21, 2021 15:30
33fd571
to
0071387
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 ofText
&String
functions, which is weird from the outside). If we want to useText
internally - that should be it, conversion can still be needed (forbase
^ GHC reasons), but at least is would be only on the IO margins (which areprelude
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 intoNix.Utils
& passing it throughPrelude
module, but then people would start importingNix.Utils
from time to time in the code base, which is Ok, since because ofPrelude
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.