Desugaring Haskell's do-notation into applicative operations Article Swipe
Related Concepts
Haskell
Computer science
Notation
Programming language
Monad (category theory)
Extension (predicate logic)
Functional programming
Arithmetic
Discrete mathematics
Functor
Mathematics
Simon Marlow
,
Simon Peyton Jones
,
Edward Kmett
,
Andrey Mokhov
·
YOU?
·
· 2016
· Open Access
·
· DOI: https://doi.org/10.1145/3241625.2976007
· OA: W4236866362
YOU?
·
· 2016
· Open Access
·
· DOI: https://doi.org/10.1145/3241625.2976007
· OA: W4236866362
Monads have taken the world by storm, and are supported by do-notation (at least in Haskell). Programmers are increasingly waking up to the usefulness and ubiquity of Applicatives, but they have so far been hampered by the absence of supporting notation. In this paper we show how to re-use the very same do-notation to work for Applicatives as well, providing efficiency benefits for some types that are both Monad and Applicative, and syntactic convenience for those that are merely Applicative. The result is fully implemented as an optional extension in GHC, and is in use at Facebook to make it easy to write highly-parallel queries in a distributed system.
Related Topics
Finding more related topics…