This SkillsCast is currently only available to registered attendees of Haskell eXchange 2021: Pro Track
It will be freely available to all Skills Matter members once the Haskell eXchange 2021: Pro Track early-access window expires on January 15, 2022.
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:
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.