forked from haskell-nix/hnix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge request haskell-nix#890 Swtitch to relude; some String -> Text …
…migration Relates to the discussion: haskell-nix#889 and the report: haskell-nix#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.
- Loading branch information
Showing
57 changed files
with
353 additions
and
579 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
cabal-version: 2.2 | ||
name: hnix | ||
version: 0.12.0.1 | ||
synopsis: Haskell implementation of the Nix language | ||
|
@@ -7,10 +8,9 @@ homepage: https://github.com/haskell-nix/hnix#readme | |
bug-reports: https://github.com/haskell-nix/hnix/issues | ||
author: John Wiegley | ||
maintainer: [email protected] | ||
license: BSD3 | ||
license: BSD-3-Clause | ||
license-file: License | ||
build-type: Simple | ||
cabal-version: >= 1.10 | ||
data-dir: data/ | ||
data-files: | ||
nix/corepkgs/buildenv.nix | ||
|
@@ -393,6 +393,10 @@ library | |
Paths_hnix | ||
hs-source-dirs: | ||
src | ||
mixins: | ||
base hiding (Prelude) | ||
, relude | ||
, relude (Relude as Prelude) | ||
ghc-options: -Wall -fprint-potential-instances | ||
build-depends: | ||
aeson >= 1.4.2 && < 1.6 | ||
|
@@ -432,6 +436,7 @@ library | |
, process >= 1.6.3 && < 1.7 | ||
, ref-tf >= 0.4.0 && <= 0.4.0.2 | ||
, regex-tdfa >= 1.2.3 && < 1.4 | ||
, relude | ||
, scientific >= 0.3.6 && < 0.4 | ||
, semialign >= 1 && < 1.2 | ||
, semialign-indexed >= 1 && < 1.2 | ||
|
@@ -448,6 +453,8 @@ library | |
, unordered-containers >= 0.2.9 && < 0.3 | ||
, vector >= 0.12.0 && < 0.13 | ||
, xml >= 1.3.14 && < 1.4 | ||
default-extensions: | ||
OverloadedStrings | ||
if flag(optimize) | ||
default-extensions: | ||
ApplicativeDo | ||
|
@@ -491,13 +498,20 @@ executable hnix | |
, pretty-show | ||
, prettyprinter | ||
, ref-tf | ||
, relude | ||
, repline >= 0.4.0.0 && < 0.5 | ||
, serialise | ||
, template-haskell | ||
, text | ||
, time | ||
, transformers | ||
, unordered-containers | ||
mixins: | ||
base hiding (Prelude) | ||
, relude | ||
, relude (Relude as Prelude) | ||
default-extensions: | ||
OverloadedStrings | ||
if flag(optimize) | ||
default-extensions: | ||
ApplicativeDo | ||
|
@@ -522,6 +536,10 @@ test-suite hnix-tests | |
ReduceExprTests | ||
TestCommon | ||
Paths_hnix | ||
mixins: | ||
base hiding (Prelude) | ||
, relude | ||
, relude (Relude as Prelude) | ||
hs-source-dirs: | ||
tests | ||
ghc-options: -Wall -threaded | ||
|
@@ -546,6 +564,7 @@ test-suite hnix-tests | |
, pretty-show | ||
, prettyprinter | ||
, process | ||
, relude | ||
, split | ||
, tasty | ||
, tasty-hedgehog | ||
|
@@ -558,6 +577,8 @@ test-suite hnix-tests | |
, transformers | ||
, unix | ||
, unordered-containers | ||
default-extensions: | ||
OverloadedStrings | ||
if flag(optimize) | ||
default-extensions: | ||
ApplicativeDo | ||
|
@@ -574,6 +595,10 @@ benchmark hnix-benchmarks | |
Paths_hnix | ||
hs-source-dirs: | ||
benchmarks | ||
mixins: | ||
base hiding (Prelude) | ||
, relude | ||
, relude (Relude as Prelude) | ||
ghc-options: -Wall | ||
build-depends: | ||
base | ||
|
@@ -588,12 +613,15 @@ benchmark hnix-benchmarks | |
, hnix | ||
, mtl | ||
, optparse-applicative | ||
, relude | ||
, serialise | ||
, template-haskell | ||
, text | ||
, time | ||
, transformers | ||
, unordered-containers | ||
default-extensions: | ||
OverloadedStrings | ||
if flag(optimize) | ||
default-extensions: | ||
ApplicativeDo | ||
|
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
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
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
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
Oops, something went wrong.