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 upDocumentation of Signal.filter is wrong #506
Comments
evancz
closed this
May 11, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jvoigtlaender commentedFeb 24, 2016
Wrong in two ways.
First:
The general behavior of the function is currently described thus:
This does not address/explain what happens in a situation like:
What will happen is that the initial value of
oddPrimesis0. But that does not follow from the documentation. The documentation mentions the "default value" only for the situation that "no updates ever flow through". But here all updates (3,5, ...) do flow through.Moreover, it makes a wrong statement about a situation like:
Since here "no updates ever flow through" (given that all of
3,5, ... are odd), the documentation predicts that the "default value provided", i.e.,0, is used. But that's not true. Actually, the signalevenPrimesas defined above is equivalent toSignal.constant 2, not toSignal.constant 0.Second:
After describing the general behavior, the documentation goes on to give an example:
The example code that is given is this:
But the statement that it (
evens) "has an initial value of zero" is wrong. Consider the casenumbers = Signal.constant 2. Thenevenshas initial value2, not0.