Hasty Briefsbeta

Death to Type Classes

3 days ago
  • #Haskell
  • #Backpack
  • #Effect Systems
  • The article explores replacing Haskell type classes with the Backpack module system, resembling OCaml.
  • Demonstrates defining a Functor signature and implementing it for Maybe, List, and IO.
  • Discusses the setup in Cabal for managing signatures and implementations.
  • Highlights the use of RebindableSyntax to control do-notation behavior.
  • Introduces a simple effect system using Backpack, with examples for file operations.
  • Compares the approach to traditional effect systems, noting benefits like clearer error messages.
  • Mentions the potential for parallel compilation of implementations.
  • Critiques the necessity of effect systems, suggesting simpler alternatives.
  • Concludes with a call to explore Backpack more seriously for effect systems.