-
Notifications
You must be signed in to change notification settings - Fork 16
Fix Reify and reflect for lists of references. Fixes #102 #103
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
Conversation
I propose the following invariant instead:
|
jvm/src/Language/Java.hs
Outdated
-- reifying induces allocations and copies. | ||
class Interpretation a => Reify a where | ||
-- | Invariant: the argument and the result are distinct. That is, the result | ||
-- and the argument share no direct JVM object references. |
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.
This is the only relevant condition:
The result and the argument share no direct JVM object references.
The values being distinct does not imply it.
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.
I'm not sure I get your point. I intended the second sentence as the definition of the word "distinct" in the first sentence. Said definition doesn't mention values. We could choose to remove introducing a definition entirely.
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.
I see. I find the meaning of distinct surprising here. It would be best to avoid it as you suggest.
jvm/CHANGELOG.md
Outdated
* The `Reify`/`Reflect` instances for `()` is now mapped to | ||
a *serializable* small JVM object. This is a more useful instance | ||
for sparkle users. | ||
* `Reify`/`Reflect` were given additional pre and post conditions. |
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.
This should be reformulated a bit.
57245ff
to
cde66ae
Compare
No description provided.