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:
- Hack & Hang Night (in Chicago on 21st February 2023)
- Haskell Wednesday: Bring Your Project, Get help with your code & socialise (Online Meetup on 23rd February 2023)
- Teaching Haskell...To High Schoolers! (SkillsCast recorded in December 2022)
- Teaching Haskell...To High Schoolers! (SkillsCast recorded in December 2022)
Lightning Talk: A Spectre is Haunting Haskell — The Spectre of Effects
Xiaoyan Ren
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.