In
computer science, arrows provide a more general interface to computation than
monads. Monads essentially provide a sequential interface to
computation: one can build a computation out of a value, or sequence two computations together. Arrows provide more possibilities, including expressing (true, nondeterministic) parallel computation. Indeed, all monads in
Haskell are instances of arrows of a particular kind, ArrowApply. Because arrows carry more type information than just the result type, composition can be more efficient — for example, eliminating space leaks.
Arrows have found use in functional reactive programming.
External links
- Arrows: A General Interface to Computation
- “Generalising Monads to Arrows”, John Hughes, in Science of Computer Programming 37, pp67–111, May 2000.
- A New Notation for Arrows, Ross Paterson, in ICFP, Sep 2001.
- Arrows and Computation, Ross Paterson, in The Fun of Programming, Palgrave, 2003.
- Arrow notation ghc manual