What about this list makes it lazy or asynchronous? Or for that matter, referentially transparent? JavaScript is strictly evaluated, you can't even construct a value in that list unless you have the value to want to add to it already. I see no function signatures indicating callbacks for asynchronous operations either. There's nothing preventing one from mutating one of the references within the list, so I'm not sure where the referentially transparent claim is coming from.
The fact that the rest of the stream is described with a parameter-less function, also called a thunk, which is how you turn strict things into lazy ones, obviously.
asynchronous
The fact that the rest of the stream can be processed with a Promise.
Or for that matter, referentially transparent?
The fact that side effects get suspended in that parameter-less function and there's no mutation involved for building it.
I see no function signatures indicating callbacks for asynchronous operations either
That's what the Promise is for. If it would work properly that is.
There's nothing preventing one from mutating one of the references within the list
I've modified the original definition to have readonly on those members, if that makes you happy :-)
I missed the Task<A> you had in the constructor signature the first time, my bad.
Also, I know what a thunk is, and your tone in these comments comes off as pretty condescending. I think you'd be better received here if you abstained from talking to people like they have no idea what they're talking about.
I apologize for sounding condescending or aggressive, I do try to explain things using less jargon (thunk is less understood jargon).
I'm also incredibly annoyed. Somebody here called me a scumbag for talking about a library I've been working on in my free time at personal sacrifice, so I don't necessarily know what I'm doing here, instead of going home to my wife and kid, but I guess I'll just pass by the bank first to retrieve my million dollars.
As you can see, my humor doesn't help much either.
7
u/bluebaron Oct 11 '17
What about this list makes it lazy or asynchronous? Or for that matter, referentially transparent? JavaScript is strictly evaluated, you can't even construct a value in that list unless you have the value to want to add to it already. I see no function signatures indicating callbacks for asynchronous operations either. There's nothing preventing one from mutating one of the references within the list, so I'm not sure where the referentially transparent claim is coming from.