项目作者: harikrishnan83

项目描述 :
Kotlin Railway Oriented Programming
高级语言: Kotlin
项目地址: git://github.com/harikrishnan83/RailwayOrientedProgramming.git


Kotlin Railway Oriented Programming

CI

https://medium.com/@harikrishnan/railway-oriented-programming-dd74dbf0dfae

@h/refactoring-if-else-either-and-flatmap-4f1ca9076664"">https://medium.com/@h/refactoring-if-else-either-and-flatmap-4f1ca9076664

Conference Talk

Proposal - The Functional Fix: Kotlin Error Handling Made Elegant

Slides - https://speakerdeck.com/harikrishnan83/the-functional-fix-kotlin-error-handling-made-elegant

Video

The Functional Fix: Kotlin Error Handling Made Elegant

Initial code

We start with this procedural code that is mainly using if-else to handle errors.

Step 0: Procedural Code

Refactoring steps

Solving the problem with Kotlin

Step 1: Method Extraction

Step 2: Lining up the functions

Step 3: Railway Oriented Programming

Using Arrow

Step 4: Using Either And FlatMap

Step 5: Extracting error handling