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

Re-fresh #267

Merged
merged 13 commits into from
Oct 17, 2019
Merged

Re-fresh #267

merged 13 commits into from
Oct 17, 2019

Conversation

robrix
Copy link
Contributor

@robrix robrix commented Oct 16, 2019

This PR fixes the outstanding issues with Fresh and its carrier.

@robrix robrix marked this pull request as ready for review October 16, 2019 01:29
Copy link
Contributor Author

@robrix robrix left a comment

Choose a reason for hiding this comment

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

Not much to say about this one that isn’t mentioned in the issues it fixes.

Ready for review.

@robrix robrix added this to the 1.0 milestone Oct 16, 2019
Copy link
Collaborator

@patrickt patrickt left a comment

Choose a reason for hiding this comment

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

One question, but looks good otherwise.

runFresh :: Functor m => FreshC m a -> m a
runFresh = evalState 0 . runFreshC
runFresh :: Int -> FreshC m a -> m (Int, a)
runFresh n = runState n . runFreshC
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to provide a function that calls runFresh 0, to mimic the behavior of runFresh prior? I could go either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don’t think it’s really worth the effort.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Or the increase in surface area.)

patrickt
patrickt approved these changes Oct 16, 2019
@robrix robrix merged commit 1c56630 into master Oct 17, 2019
@robrix robrix deleted the re-fresh branch October 17, 2019 07:01
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.

Control.Carrier.Fresh.Strict doesn’t make safe operation easy resetFresh is dangerous and easy to misuse
2 participants