-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix Streaming#memoization. #665
Conversation
This commit fixes a bug noticed by @ceedubs. The basic issue is that we have to be sure to memoize the Eval instance holding the tail while *also* memoizing the tail itself when it is calculated. Previously we were only memoizing the head node.
* There are two calls to memoized here -- one is a recursive call | ||
* to this method (on the tail) and the other is a call to memoize | ||
* the Eval instance holding the tail. For more information on how | ||
* .memoize works see Eval#memoize. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: could we turn this into a proper ScalaDoc link? [[cats.Eval.memoize]]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sure.
This fixes (and replaces) #662. I left a minor request about the ScalaDoc, but 👍 from me (assuming the build passes). |
Current coverage is
|
} | ||
|
||
// convert List[A] to Streaming[A] | ||
def convert[A](as: List[A]): Streaming[A] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used anywhere, or just added for possible future use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, looks like I left that in. I'll remove it.
👍 once question about function is answered :-) |
Strange error, rebuilding, once it's green 👍 |
This commit fixes a bug noticed by @ceedubs. The basic issue
is that we have to be sure to memoize the Eval instance holding
the tail while also memoizing the tail itself when it is
calculated. Previously we were only memoizing the head node.