Skip to content

trivial Lazy instance for functions #38

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

Merged
merged 3 commits into from
May 28, 2017

Conversation

matthewleon
Copy link
Contributor

No description provided.

@paf31
Copy link
Contributor

paf31 commented Apr 4, 2017

👍

@matthewleon
Copy link
Contributor Author

Might be worth waiting until I add some tests on this. Not sure it's working exactly the way I thought it would.

@matthewleon
Copy link
Contributor Author

matthewleon commented Apr 4, 2017

In particular, I'm not sure if this makes any sense given that fix will diverge if used directly on this instance.

Maybe it still makes sense though in those contexts in which you have a Lazy a => Lazy (f a).

@paf31 perhaps you have some advice here?

@matthewleon
Copy link
Contributor Author

Got it to stop diverging... Will update shortly.

@matthewleon
Copy link
Contributor Author

Okay, this feels right now. Happy to have this reviewed.

@@ -11,7 +11,7 @@ class Lazy l where
defer :: (Unit -> l) -> l

instance lazyFn :: Lazy (a -> b) where
defer f = f unit
defer f = \x -> f unit x
Copy link
Member

Choose a reason for hiding this comment

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

Now I see it, this definitely looks like the right thing 👍

@paf31 paf31 merged commit c393ee5 into purescript:master May 28, 2017
@paf31
Copy link
Contributor

paf31 commented May 28, 2017

Thanks!

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.

3 participants