juan_gandhi: (VP)
[personal profile] juan_gandhi
Decided to reread this:

http://docs.scala-lang.org/overviews/core/futures.html

"The most general form of registering a callback is by using the onComplete method, which takes a callback function of type Try[T] => U"


Guys, do you seriously think accepting a monad is a good solution? What is the type of your function? Well, it's a comonad, but I wonder if they know that.


"The callback is applied to the value of type Success[T] if the future completes successfully, or to a value of type Failure[T] otherwise."


Ever heard of XHR? They just have two functions, onsuccess and onerror. If you have a union, it's better to define a function on components.

Actually, they have it all. onSuccess, onFailure.

"The onComplete, onSuccess, and onFailure methods have result type Unit, which means invocations of these methods cannot be chained."

Oh. It's all so... not exactly wrong, but so misrepresented...

"This can be mind-boggling, but fortunately the flatMap operation is seldom used outside for-comprehensions, which are easier to use and understand."

Interesting. Which century was it?

"The recover combinator creates a new future which holds the same result as the original future if it completed successfully."

"The recoverWith combinator creates a new future which holds the same result as the original future if it completed successfully."

"The recoverWith combinator creates a new future which holds the same result as the original future if it completed successfully."

What a life!

"The andThen combinator is used purely for side-effecting purposes. It returns a new future with exactly the same result as the current future, regardless of whether the current future failed or not."

"we create a promise and use its future method to obtain the Future that it completes"

I remember reading it with almost an awe.
Now it all looks funny, like Ulysses - but Ulysses is actually funny, while this one is basically just a little bit sick. Is it not?

Date: 2016-08-26 03:27 am (UTC)
From: [identity profile] exceeder.livejournal.com
Apologies in advance. At the risk of being called a grammar nazi, long form of "Isn't it?" equals to "Is it not?". "Not" always comes after the subject, unless it is a contracted form.

Enjoyable read. Futures and Promises are a zoo in most languages. I have yet to find one I like in most situations. That said, I tried to implement it once by myself and failed miserably to meet all the goals. It is rather hard if you eye performance and flexibility simultaneously. But fun.

Date: 2016-08-26 03:40 am (UTC)
From: [identity profile] soonts.livejournal.com
I just love the way they’re implemented in .NET.

I’ve been using the technology since 2011, the CTP for VS2010 had a go live license.

Date: 2016-08-26 04:50 am (UTC)
From: [identity profile] juan-gandhi.livejournal.com
lmgtfy
https://www.quora.com/Is-isnt-it-grammatically-correct

Regarding implementing them, it probably takes some mental efforts to come up with a proper model. TLA, Pi-calculus, Actors Model... or just fork/join - these are the alternatives, I guess. Maybe more.

Date: 2016-08-26 06:21 am (UTC)
From: [identity profile] thedeemon.livejournal.com
That quora link is about the short form which is fine.
"Isn't it?" and "is it not?" are fine.
"It not it?" sounds awkward.

Date: 2016-08-26 07:24 am (UTC)
From: [identity profile] punk-floyd.livejournal.com
Да, выглядит очень резоглазуще :-)

Интересно, откуда взялось, из какого учебника :-)

Date: 2016-08-26 02:08 pm (UTC)
From: [identity profile] juan-gandhi.livejournal.com
Eckersley; but thanks.

Date: 2016-08-26 02:59 pm (UTC)
From: [identity profile] punk-floyd.livejournal.com
ого, впервые слышу
поискал, это что-то из 50-х годов, возможно тогда в Англии(?) так писали

Date: 2016-08-26 05:19 pm (UTC)
From: [identity profile] juan-gandhi.livejournal.com
В 50-е в Англии писали так: "what are these gay old pussies doing here?" (Агафья Кристи так писала)

Date: 2016-08-27 06:36 am (UTC)
From: [identity profile] punk-floyd.livejournal.com
какая прелесть :-)

Date: 2016-08-26 02:09 pm (UTC)
From: [identity profile] juan-gandhi.livejournal.com
Ok, right, fixed it now. Thanks.

Date: 2016-08-27 07:36 pm (UTC)
stas: (Default)
From: [personal profile] stas
По неверной дорожке nodejs идут?

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10 11 12 13141516
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 14th, 2025 11:18 pm
Powered by Dreamwidth Studios