←back to thread

292 points kristoff_it | 2 comments | | HN request time: 0.535s | source
Show context
raluk ◴[] No.44609651[source]
One thing that most languages are lacking is expressing lazy return values. -> await f1() + await f2() and to express this concurently requres manually handing of futures.
replies(3): >>44609880 #>>44610056 #>>44610348 #
sedatk ◴[] No.44609880[source]
Which languages do have such a thing?
replies(2): >>44610179 #>>44610709 #
1. Twey ◴[] No.44610179[source]
I suppose Haskell does, as `(+) <$> f1 <*> f2`.
replies(1): >>44612756 #
2. raluk ◴[] No.44612756[source]
In there is also ApplicativeDo that works nicely with this.

    do 
      x <- f1
      y <- f2
      return $ x + y
this is evaluated as applicative in same way.