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

Migrating code to new demand implementation #873

Merged

Conversation

Anton-Latukha
Copy link
Collaborator

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

  • ✔️ Gradual switches where posible.
  • ✔️ All uses of it, including all Builtins are processed.
  • ✔️ A couplr of several level do blocks became 1.
  • ✔️ Several of the monadic binds became functors.
  • ✔️ ChangeLog (also would be rewritten couple of times by the further change updates)

This almost fully closes the #850

What is further left there is basically to move Kleisli out of inform, informF is for that, then do the includes of the function uses inside the do blocks and fold the lambdas, binds and do blocks further. With the current lispy sectioning, it is easy and semi-automatic.

@Anton-Latukha Anton-Latukha force-pushed the 2021-03-04-migrate-code-to-new-demand-implementation branch from 38be796 to 80c3ec6 Compare March 5, 2021 08:25
@Anton-Latukha Anton-Latukha marked this pull request as ready for review March 5, 2021 08:25
@Anton-Latukha Anton-Latukha force-pushed the 2021-03-04-migrate-code-to-new-demand-implementation branch from 80c3ec6 to de21598 Compare March 5, 2021 08:43
Builtins, it is 44 uses.
Other also.

Some refactor in the process.

Couple of monadic binds become functors.

After this change the code allows more refactors - move `demand`s into `do`
blocks and fold the `do` blocks.
@Anton-Latukha Anton-Latukha force-pushed the 2021-03-04-migrate-code-to-new-demand-implementation branch 2 times, most recently from 4c5cead to 22f320c Compare March 5, 2021 09:30
@Anton-Latukha Anton-Latukha force-pushed the 2021-03-04-migrate-code-to-new-demand-implementation branch from 22f320c to 0112b53 Compare March 5, 2021 09:36
@Anton-Latukha Anton-Latukha merged commit d06b8d7 into master Mar 5, 2021
@Anton-Latukha Anton-Latukha deleted the 2021-03-04-migrate-code-to-new-demand-implementation branch March 5, 2021 09:57
@@ -351,7 +351,7 @@ buildDerivationWithContext drvAttrs = do
-- common functions, lifted to WithStringContextT

demandF' :: (NValue t f m -> WithStringContextT m a) -> NValue t f m -> WithStringContextT m a
demandF' f v = join $ lift $ demandF (pure . f) v
demandF' f v = join $ lift $ f <$> demand v
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to myself: It seems that demand' -> demandF' was not reverted. For consistency it should probably also be flipped.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

2 participants