Published: 22 January 2023
Tags: compiler, functional, haskell
Erik Engheim explains how to do I/O in a pure functional language using Algebraic Effects.
- In a functional programming language, I/O is typically done using algebraic effects
- This allows for the ability to "bubble up" the call stack until you decide to handle them, similar to how methods in Java need to be declared as throwing exceptions if they call one or more other methods throwing exceptions
- "I/O code can look complex primarily because you are unaccustomed to Unison style error handling", but once you learn it, it becomes a fairly obvious solution