What is freer-simple and how does it work?
masterThe freer-simple library provides an implementation of an extensible effect system for Haskell. It allows you to track effects (such as state mutation, file system interaction, random number generation, or environment access) at the type level.
Key capabilities include:
- An efficient effect system designed as a library.
- Built-in implementations for common monads like
Reader,Writer,State, andError. - A combinator language for defining and composing custom effects.
Users typically define their own effects using GADTs and then write interpreters to handle those effects, either by performing real-world side effects (e.g., using IO) or by simulating them purely (e.g., using State or Writer).