Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upfixing Stream.sample in Elm-0.15 #193
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Mar 11, 2015
Member
Nice find, thank you for the fix!
I wonder if this pattern of A, B, or both will show up in other places.
|
Nice find, thank you for the fix! I wonder if this pattern of A, B, or both will show up in other places. |
pushed a commit
that referenced
this pull request
Mar 11, 2015
evancz
merged commit 867c9d7
into
elm:master
Mar 11, 2015
1 check failed
jvoigtlaender
deleted the
jvoigtlaender:fixSample
branch
Mar 11, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Mar 11, 2015
Contributor
In such situtations, what I'd actually do is to model the thing as (Maybe A, Maybe B) rather than via type SomeOfAB a b = OnlyA a | OnlyB b | Both a b. For the concrete case, doing it like this: jvoigtlaender@f7262c0. There, it simplifies the definition of the sampleUpdate function quite a bit.
The only reason I didn't right away do this in the pull request here is that I wanted it to be the minimal fix (in terms of changed lines and cognitive load).
|
In such situtations, what I'd actually do is to model the thing as The only reason I didn't right away do this in the pull request here is that I wanted it to be the minimal fix (in terms of changed lines and cognitive load). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Mar 12, 2015
Member
That looks great to me, do you mind making a PR for that?
I also changed fps to a Stream which I think simplified stuff there, but I may have messed things up.
|
That looks great to me, do you mind making a PR for that? I also changed |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Mar 12, 2015
Contributor
Have added a PR here: https://github.com/elm-lang/core/pull/195.
I'll also try to take a look at the new version of fps separately.
|
Have added a PR here: https://github.com/elm-lang/core/pull/195. I'll also try to take a look at the new version of |
jvoigtlaender commentedMar 10, 2015
The current 0.15 version is broken for situations like this:
The output is never updating! That cannot be what is supposed to happen, right?
The commit here fixes this in the way that changes the existing code of
Stream.samplethe least.