‹ BackHN Continuity

Thread

Effect 4.0

87 points · 70 comments · stevefan1999

  1. chrysoprace · · focus · HN ↗
    Is there a way to implement Effect without it becoming a leaky abstraction that takes over your whole app? Presumably you'd have to create an entire abstraction layer with strict boundaries, such as nestjs does with RxJS Observables, but even that has problems with leaking Observables when you need to hook into the framework's lifecycle.
    1. ruby14 · · focus · HN ↗
      Absolutely you can. Every Effect program has to be run via some call to a ‘runX()’ function that accepts your Effect program. And the call-site where you run it is the boundary of your Effect program so you can make your app as much or as little Effect as you want.
    2. ezst · · focus · HN ↗
      Thinking of it abstractly, Effects is a more generic version of the "what color is your function"¹ dilemma, and the way to make this kind of abstraction not "color too much" (i.e. not pollute the core language by wrapping everything in a monad that implements its own parallel runtime with exceptions, asynchrony, …) is an active research topic². Scala is advancing in this area by scoping effects in a manner that's not too dissimilar to a generalized version of rust's borrow-checker, and I'm very curious to see how that spans out.

      ¹: <a href="https:&#x2F;&#x2F;journal.stuffwithstuff.com&#x2F;2015&#x2F;02&#x2F;01&#x2F;what-color-is-your-function&#x2F;" rel="nofollow">https:&#x2F;&#x2F;journal.stuffwithstuff.com&#x2F;2015&#x2F;02&#x2F;01&#x2F;what-color-is-...

      ²: <a href="https:&#x2F;&#x2F;www.scala-lang.org&#x2F;api&#x2F;3.5.0&#x2F;docs&#x2F;docs&#x2F;reference&#x2F;experimental&#x2F;cc.html" rel="nofollow">https:&#x2F;&#x2F;www.scala-lang.org&#x2F;api&#x2F;3.5.0&#x2F;docs&#x2F;docs&#x2F;reference&#x2F;exp...

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.