10 tips to write fast stack-safe functional code in Scala: the automatic-batching library experience report
Have you ever heard the belief of functional programming being slow? Have you ever been caught by a `StackOverflowError` in your recursive functions? Have you ever rewritten your functional code into imperative style to make it fast and stack-safe? What if i told you how to write fast and stack-safe functional code? Even for non tail-recursive functions! 😉 In this talk i’ll present you 10 tips to write fast and stack-safe functional code. It is based on my experience implementing [Auto-Batch]( a pure functional-programming Scala library to automatically batch API calls. Through these 10 tips, we’ll discuss many subjects together: what `@tailrec` really means and how to bypass it, how to make most functions tail-recursive, how to be sure your code is really stack-safe, which free data-structure to choose for your need, how to use smart constructors to speed things up, “hidden” features of the IO monads, applicatives vs monads, why parametricity is your friend, are Generalized Algebraic Data Types really useful (spoiler alert, they are!), is there a concrete use-case of continuation-passing style, …
Nguồn: https://ka-nom.com/
Xem thêm bài viết khác: https://ka-nom.com/game/
Xem thêm Bài Viết:
- Hướng dẫn cách chơi game bắn cá vua hải tặc trên máy tính
- Hướng dẫn chi tiết cách tải game bắn cá miễn phí về điện thoại nhanh nhất
- Let's Play STORY OF A GLADIATOR Gameplay PC Part 1 (ENTER THE ARENA)
- FROG PRINCE drawing for DUNGEON KNIGHT Board Game
- Tracy McGrady Huge Half Windmill Alley Oop Vs Raptors 12-11-10