Session

Stay on Track - Railway Oriented Programming for Smooth Error Handling

When starting to learn functional programming, one typically starts off with a simple problem or kata where error conditions can be ignored or hand-waved away which allows one to focus on the business logic. Eventually, however, you will need to expand your knowledge to deal with the absence of values and error conditions.

Unlike most Object-Oriented languages which leverage nulls or exceptions, functional languages tend to encode these error conditions into types like Maybe and Either which the compiler then can enforce that the developer handles the error. However, how does one combine these types to accomplish a flow of logic in your application?

In this session, I'll show you what these two different types are, how to refactor your code to leverage these types and apply a technique known as Railway Oriented Programming to handle your error conditions in a more concise manner.

Intended for those new to functional programming, by the end of this session, you will know when to use Maybe and Either in your codebase, how to refactor existing code to leverage these types, and how to combine these concepts into a pipeline leveraging Railway Oriented Programming. Examples will be in .NET and TypeScript but are applicable to other languages.

A projector is all that's needed to present this topic. It's best done with a 50+ minute time slot, but if the audience is already familiar with Maybe and Either, then it can be easily converted to a 30-minute presentation.

Cameron Presley

Knowledge Sharer and Problem Solver

Charlotte, North Carolina, United States

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top