-
Notifications
You must be signed in to change notification settings - Fork 704
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
Add Lazy data and Delay type class #1993
base: series/8.0.x
Are you sure you want to change the base?
Conversation
Could you give a little background as to why this is needed? |
Sure, will do tomorrow. |
I worked on a similar |
Should there be a law that says |
@Milyardo We could have that, though what makes for |
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.
to not include the semantics of evaluating "whatever's inside" a.
why not?
|
||
import tc._ | ||
|
||
class Lazy[A](val run: () => 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.
final
?
/** | ||
* Given `Delay[A]`, one can suspend execution of an `A` inside of the `A` itself. | ||
*/ | ||
trait DelayClass[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.
so what's a good use case for Delay
?
Tests incoming.
I believe this is the beginning of a way to solve the lazy type classes problem in Scala.