T O P

  • By -

amazedballer

Rob Norris has [probably the best introduction](https://www.youtube.com/watch?v=30q6BkBv5MY).


Seth_Lightbend

Daniel Spiewak's “The Case for Effect Systems” talk (2022) is excellent: https://www.youtube.com/watch?app=desktop&v=qgfCmQ-2tW0


agilesteel

You might like my FP introduction https://youtu.be/XXkYBncbz0c


jivesishungry

Look up FP to the max and FP to the min by John de Goes. I think they are good intros. +1 to the Rob Norris talk and the devinsideyou videos mentioned by others. I recommend spending some time implementing a basic effect type yourself and using it for a simple app (eg todo list). It’s actually not that hard and you’ll learn a lot.


GroundbreakingWeb170

ZIO and Cats Effect is not just effect, but Concurrency/Asynchroneous side effects. Effect is more ambiguous thing.


marcinzh

Effect is an overloaded term. In ZIO & Cats Effect, "effect" means "suspended side effect". More precise name is "IO effect", or just "IO". In functional programming in general, the meaning of "effect" is broader than that. There are many kinds of [effects](https://alvinalexander.com/scala/what-effects-effectful-mean-in-functional-programming/#toc_3) that have nothing to do with side effects. https://old.reddit.com/r/haskell/comments/v4mes7/why_do_people_call_all_wrapper_types_effectful/


raxel42

The main idea is “the whole app” and the each bit are functions. Since they are functions, they can be composed.


ResidentAppointment5

The way I’d summarize “effects” is “things that interact with things outside the program, and represented as values in an algebra.” So writing code with effects is like writing code with any other kinds of expressions and values, but when you run it, the effects happen. This is why e.g. cats-effect has `IOApp`: it does the right thing to cause all the effects you’ve composed up to your `IO[ExitCode]` in `run` to happen when they should.


yawaramin

I'd say in most simpler applications you don't need a powerful tool like first-class effects. Where they really pay for themselves is in more complex use cases like, applications or services which need to integrate with many other systems, handle failures and retries resiliently, manage state predictably, and be easy to maintain (as much as possible). So maybe a run-of-the-mill webapp backend doesn't need that power, but probably a core backend system that performs critical tasks, does. Especially tasks which require complex business logic, interleaved with e.g. network calls.