u/kubukozcats,cats-effectin r/scala • Recommends
Recursion pitfalls in IO monads and how to avoid them
#cats-effect#iomonad#recursion
3.7K subscribers • 30 videos on Hallway
Intermediate. Assumes working knowledge.
1.3K views4 years ago1 recommendation
Programming languagesSoftware designScalaFunctional programmingMemory management
Jakub Kozłowski explains how to avoid OutOfMemoryError and StackOverflowError when using recursion in Scala IO monads.
Back after a sick break :) in this video, I'm talking about traps you can easily fall into when using any IO/Task effect/monad (or any monad, for that matter), and how to avoid them. I'm on Twitter: twitter.com/kubukoz on GitHub: github.com/kubukoz sometimes stream on Twitch: twitch.tv/kubukoz And you can buy me a coffee if you want: ko-fi.com/kubukoz Read the code: github.com/kubukoz/videos/tree/main/io-recursion-pitfalls - Introduction, overview - OutOfMemoryError - example, explanation - OOM - solutions - StackOverflowError - example, explanation - SOE - solutions - Recursion tip: Defer.fix function - Summary, parting words Find out more: Better Monadic For: github.com/oleg-py/better-monadic-for IO tutorial: typelevel.org/cats-effect/docs/tutorial Defer typeclass: github.com/typelevel/cats/blob/main/core/src/main/scala/cats… Another example of a useful Defer instance in the context of `fix`: github.com/typelevel/cats-parseWhat people say. Recommended for its clear explanation of recursion pitfalls and memory issues when working with IO monads in Scala.
u/kubukozcats,cats-effectin r/scala • Recommends