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

Replace "constant" by "input" where appropriate #125

Merged
merged 8 commits into from Jan 22, 2015

Conversation

Projects
None yet
2 participants
@jvoigtlaender
Contributor

jvoigtlaender commented Jan 21, 2015

No description provided.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 21, 2015

Contributor

Like this?

Contributor

jvoigtlaender commented Jan 21, 2015

Like this?

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 22, 2015

Contributor

Corresponding changes are still to be done in Http.js, Keyboard.js, and WebSockets.js, but due to expected merge conflicts it does not make sense to go at these before https://github.com/elm-lang/core/pull/127 has been integrated into master.

Contributor

jvoigtlaender commented Jan 22, 2015

Corresponding changes are still to be done in Http.js, Keyboard.js, and WebSockets.js, but due to expected merge conflicts it does not make sense to go at these before https://github.com/elm-lang/core/pull/127 has been integrated into master.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 22, 2015

Contributor

That should be it.

There are still calls to Signal.constant from JS here: https://github.com/jvoigtlaender/core/blob/constant-to-input/src/Native/Runtime.js#L289 and here: https://github.com/jvoigtlaender/core/blob/constant-to-input/src/Native/Time.js#L59. But at least the latter is really also "semantically" meant to be a constant signal. I'm not sure about the former occurrence in Runtime.js.

Contributor

jvoigtlaender commented Jan 22, 2015

That should be it.

There are still calls to Signal.constant from JS here: https://github.com/jvoigtlaender/core/blob/constant-to-input/src/Native/Runtime.js#L289 and here: https://github.com/jvoigtlaender/core/blob/constant-to-input/src/Native/Time.js#L59. But at least the latter is really also "semantically" meant to be a constant signal. I'm not sure about the former occurrence in Runtime.js.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 22, 2015

Contributor

Actually, the occurrence of Signal.constant at https://github.com/jvoigtlaender/core/blob/constant-to-input/src/Native/Runtime.js#L289 should probably be replaced by Native.Signal.input, as well as the occurrence of Signal.constant here: https://github.com/elm-lang/elm-reactor/blob/60b8dca16d5ba4a95a6a2aafe7d89a5a207639d6/frontend/debugger-implementation.js#L729.

Contributor

jvoigtlaender commented Jan 22, 2015

Actually, the occurrence of Signal.constant at https://github.com/jvoigtlaender/core/blob/constant-to-input/src/Native/Runtime.js#L289 should probably be replaced by Native.Signal.input, as well as the occurrence of Signal.constant here: https://github.com/elm-lang/elm-reactor/blob/60b8dca16d5ba4a95a6a2aafe7d89a5a207639d6/frontend/debugger-implementation.js#L729.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jan 22, 2015

Member

Yeah, I think that's fine. It feels a little weird to be importing both Signal and Native.Signal though, that's my one hesitation. Do you have an opinion about whether what the right thing is here?

Member

evancz commented Jan 22, 2015

Yeah, I think that's fine. It feels a little weird to be importing both Signal and Native.Signal though, that's my one hesitation. Do you have an opinion about whether what the right thing is here?

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jan 22, 2015

Member

Oops, I commented but had not refreshed the page, so I did not see any of the comments from today! I'll review again now!

Member

evancz commented Jan 22, 2015

Oops, I commented but had not refreshed the page, so I did not see any of the comments from today! I'll review again now!

evancz pushed a commit that referenced this pull request Jan 22, 2015

Merge pull request #125 from jvoigtlaender/constant-to-input
Replace "constant" by "input" where appropriate

@evancz evancz merged commit 29c6f52 into elm:master Jan 22, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jan 22, 2015

Member

Everything looks good. I'd be sort of inclined to use Native.Signal for all of the map needs, but I'm not sure if that's a good idea or if it really matters.

Member

evancz commented Jan 22, 2015

Everything looks good. I'd be sort of inclined to use Native.Signal for all of the map needs, but I'm not sure if that's a good idea or if it really matters.

@jvoigtlaender jvoigtlaender deleted the jvoigtlaender:constant-to-input branch Jan 22, 2015

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 22, 2015

Contributor

Oh, right, I hadn't noticed that most of the remaining Signal use is for Signal.map, and Signal.map is just an indirection to Native.Signal.map. So yes, one could avoid a bunch of indirections here. I'll not touch this, though.

But I'll do PRs to replace the constant uses at https://github.com/elm-lang/core/blob/master/src/Native/Runtime.js#L289 and https://github.com/elm-lang/elm-reactor/blob/60b8dca16d5ba4a95a6a2aafe7d89a5a207639d6/frontend/debugger-implementation.js#L729, because these are signals that will get updates.

Contributor

jvoigtlaender commented Jan 22, 2015

Oh, right, I hadn't noticed that most of the remaining Signal use is for Signal.map, and Signal.map is just an indirection to Native.Signal.map. So yes, one could avoid a bunch of indirections here. I'll not touch this, though.

But I'll do PRs to replace the constant uses at https://github.com/elm-lang/core/blob/master/src/Native/Runtime.js#L289 and https://github.com/elm-lang/elm-reactor/blob/60b8dca16d5ba4a95a6a2aafe7d89a5a207639d6/frontend/debugger-implementation.js#L729, because these are signals that will get updates.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 22, 2015

Contributor

I take these back. In those places, when those signals are created, they are actually constant. (Because it's for cases like where main : Element is artifically made a main : Signal Element.)

Contributor

jvoigtlaender commented Jan 22, 2015

I take these back. In those places, when those signals are created, they are actually constant. (Because it's for cases like where main : Element is artifically made a main : Signal Element.)

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jan 22, 2015

Member

Yeah, I agree, constant makes sense in those cases. We'll save map for another time, when we are feeling more decisive :)

Thanks a ton for improving this!

Member

evancz commented Jan 22, 2015

Yeah, I agree, constant makes sense in those cases. We'll save map for another time, when we are feeling more decisive :)

Thanks a ton for improving this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment