Skip to content

trivial Lazy instance for functions#38

Merged
paf31 merged 3 commits intopurescript:masterfrom
matthewleon:lazy-function
May 28, 2017
Merged

trivial Lazy instance for functions#38
paf31 merged 3 commits intopurescript:masterfrom
matthewleon:lazy-function

Conversation

@matthewleon
Copy link
Copy Markdown
Contributor

No description provided.

@paf31
Copy link
Copy Markdown
Contributor

paf31 commented Apr 4, 2017

👍

@matthewleon
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@matthewleon
Copy link
Copy Markdown
Contributor Author

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


instance lazyFn :: Lazy (a -> b) where
defer f = f unit
defer f = \x -> f unit x
Copy link
Copy Markdown
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
Copy Markdown
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