Please log in to watch this conference skillscast.
Existing effect systems in Haskell all use one of two approaches: Free monad or effect typeclasses. As Alexis King pointed out in her talk in ZuriHac 2020, these two approaches are both unfriendly to compiler optimization because they all generalize too much, making neither effectful operations nor bind operations inlinable.
A design pattern comes to rescue, the “phantom constraint pattern.” It works with effect typeclasses, in particular the ReaderT pattern. It allows users to write effectful code on a concrete monad, which is much more friendly to the optimizer than a free/polymorphic monad, while at the same time having the ability to control the use of effects via specific redundant constraints that contain no information.
I will also talk about a work-in-progress effects library of mine, availability, that uses the said design pattern. I will give a comparison of its usage against other libraries and its design concerns.
YOU MAY ALSO LIKE:
- Haskell eXchange 2022: Novice Track (Online Conference on 7th December 2022)
- Haskell eXchange 2022: Online Conference (Online Conference on 8th - 9th December 2022)
- Haskell: Why and How the External STG Interpreter is Useful (SkillsCast recorded in December 2021)
- Keynote — Haskell: What To Do When Success Can't Be Avoided (SkillsCast recorded in November 2021)
Lightning Talk: A Spectre is Haunting Haskell — The Spectre of Effects
Xiaoyan Ren is a student who is enthusiastic about functional programming and PLT. She has written Haskell for 2 years and works with the awesome people at the PLCT Lab in ISRC, CAS building the Aya proof assistant. She loves to chat about dependent type theory and the implementation of type system elaboration.