Freer monads, more extensible effects

Research output: Chapter in Book/Report/Conference proceedingConference contribution

33 Citations (Scopus)

Abstract

We present a rational reconstruction of extensible effects, the recently proposed alternative to monad transformers, as the confluence of efforts to make effectful computations compose. Free monads and then extensible effects emerge from the straightforward term representation of an effectful computation, as more and more boilerplate is abstracted away. The generalization process further leads to freer monads, constructed without the Functor constraint. The continuation exposed in freer monads can then be represented as an efficient type-aligned data structure. The end result is the algorithmically efficient extensible effects library, which is not only more comprehensible but also faster than earlier implementations. As an illustration of the new library, we show three surprisingly simple applications: non-determinism with committed choice (LogicT), catching IO exceptions in the presence of other effects, and the semi-automatic management of file handles and other resources through monadic regions. We extensively use and promote the new sort of 'laziness', which underlies the left Kan extension: instead of performing an operation, keep its operands and pretend it is done.

Original languageEnglish
Title of host publicationHaskell 2015 - Proceedings of the 8th ACM SIGPLAN Symposium on Haskell, co-located with ICFP 2015
EditorsBen Lippmeier
PublisherAssociation for Computing Machinery, Inc
Pages94-105
Number of pages12
ISBN (Electronic)9781450338080
DOIs
Publication statusPublished - 2015 Aug 30
Event8th ACM SIGPLAN Symposium on Haskell, Haskell 2015 - Vancouver, Canada
Duration: 2015 Sep 32015 Sep 4

Publication series

NameHaskell 2015 - Proceedings of the 8th ACM SIGPLAN Symposium on Haskell, co-located with ICFP 2015

Other

Other8th ACM SIGPLAN Symposium on Haskell, Haskell 2015
CountryCanada
CityVancouver
Period15/9/315/9/4

Keywords

  • Coroutine
  • Effect handler
  • Effect interaction
  • Free monad
  • Kan extension
  • Open union
  • Type and effect system

ASJC Scopus subject areas

  • Computer Science Applications
  • Software
  • Electrical and Electronic Engineering

Fingerprint Dive into the research topics of 'Freer monads, more extensible effects'. Together they form a unique fingerprint.

  • Cite this

    Kiselyov, O. E., & Ishii, H. (2015). Freer monads, more extensible effects. In B. Lippmeier (Ed.), Haskell 2015 - Proceedings of the 8th ACM SIGPLAN Symposium on Haskell, co-located with ICFP 2015 (pp. 94-105). (Haskell 2015 - Proceedings of the 8th ACM SIGPLAN Symposium on Haskell, co-located with ICFP 2015). Association for Computing Machinery, Inc. https://doi.org/10.1145/2804302.2804319