-
Notifications
You must be signed in to change notification settings - Fork 29
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
Improve documentation #18
Comments
Just wanted to share few thoughts.
Does it still apply to a live stream? With list we usually know all the values and can evaluate its length. But how can we evaluate the stream length if that can change?
What about the other combinations - apply Stream to Behavior and Behavior to Behavior?
Can
Also here? That way there are fewer basic methods and others would be derived.
Another partial reduce, of which
That seems derived from applying the identity and filtering thereafter.
Not sure I understand this. Is that just like map into the identity?
|
You have definitely made a lot of really good observations! 😄
I agree. The documentation is rather abstract as of now 😭
Conceptually it does. In theory, we could know all past and future occurrences and represent them as a list. But in practice, we can't really do that.
I can't see how applying a stream to a behaviour makes sense. But for applying a behavior to a behavior there is the
No. And strictly speaking the normal
Yes. Definetly. export function split<A>(predicate: (a: A) => boolean, stream: Stream<A>): [Stream<A>, Stream<A>] {
return [stream.filter(predicate), stream.filter((a) => !predicate(a))];
}
Yes. That is spot on.
I hadn't thought of that. But I think you are right 👍
Semantically function snapshot(behavior, stream) {
return stream.map(({time}) => ({time, value: behavior(time)}));
} For each occurrence in the stream we ask the behavior "what is your value right now?". And then a new stream is returned where the values in the first stream is replaced by the behavior's value at those points in time.
Yes. That is definitely a good idea. How do you think we should do that? Should we have a list of "essential" combinators and a list of "extra" combinators? |
Thank you 😄 And thank you for your explanations.
You can apply a stream of functions
I think I would try to look from the perspective of the lazy pragmatic user. ;) I think people are already convinced that streams are important, so we can start there.
Then I would move to the "core" methods, first just for streams, preferably really a small number, none of which would be derivable from others and from Next the derived convenience methods can follow. Like for example, I would think, ironically, a really small focused core may gain better appreciation than a longer one with possibly more work behind. :) The thing with behaviors, it may take a while to some people to accept it. Many would just be interested in streams, so mixing streams and behaviours may scare them away. But then again, giving clear examples demonstrating the necessity may be convincing. But the convincing part may not be easy, because people will try to do everything with streams, and maybe succeed with most of anything they need. For instance, you can model mouse movement or animation with some discrete stream based framing, where you get the behaviour property but you can still implement them with streams (like that library by James, https://github.com/JAForbes/pointer-stream). So more clear convincing implementation examples may be needed. Something like in Dr. Frisby course where the coding size gets down to 1/10. :) These are just some brainstorming, mostly naive, that you can surely ignore as with your multiple widely adopted other libraries, I am sure you have other good ideas :) |
Yes, I have meant it only for the arrays, with the Even for trees, that are foldable and traversable, it is not clear how to define the stream :: t -> [Pair t a] So at every time Is there any possible flaw in this reasoning? |
Having complete docs would really help in adoption. |
Agreed @jethrolarson 😄 Are there anything in particular that you think lacks documentation? |
I looked at Future and it only shows two methods though looking at the
source it provides monad interfaces and maybe more
…On Fri, Jun 1, 2018, 2:44 AM Simon Friis Vindum ***@***.***> wrote:
Agreed @jethrolarson <https://github.com/jethrolarson> 😄 Are there
anything in particular that you think lacks documentation?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB-4BFg19uyKRSdazos-feIh0dCIY8Qks5t4QzhgaJpZM4LQHJq>
.
|
The documentation is currently pretty bad.
Add
Stream
Behavior
Now
The text was updated successfully, but these errors were encountered: