Monad.Reader's ArrowsIntroduction article.
See also Research papers/Monads and arrows.
Reasons, when it may be worth of solving a specific problem with arrows (instead of monads) can be read in a message from Daan Leijen.
Control.Arrow is the standard ibrary for arrows.
Arrow transformer library (see the bottom of the page) is an extension with arrow transformers, subclasses, useful data types (Data.Stream, Data.Sequence).
Various concepts follow here, which can be seen as concrete examples covered by the arrow concept. Not all of them provide links to Haskell-related materials: some of them are here only to give a self-contaned material (e.g. section #Automaton gives links only to the finite state concept itself.).
The funny thing which took a long time for me to understand arrow parsers is a sort of differential approach -- in contrast to the well-known parser approaches. (I mean, in some way well-known parsers are of differential approach too, in the sense that they manage state transitions where the states are remainder streams -- but here I mean being differential in another sense: arrow parsers seem to me differential in the way how they consume and produce values -- their input and output.)
The idea of borrowing this image from mathematical analysis comes from another topic: the version control systems article Integrals and derivatives written by Martin Pool uses a similar image.Arrows and Computation written by Ross Paterson (pages 2, 6, 7) mentions that computation (e.g. state) is threaded through the operands of
-- | Match zero or more occurences of the given parser. many :: MD i o -> MD i [o] many = MStar -- | Match one or more occurences of the given parser. many1 :: MD i o -> MD i [o] many1 x = (x &&& MStar x) >>> pure (\(b,bs) -> (b:bs))
between :: MD i t -> MD t close -> MD t o -> MD i o between open close real = open >>> (real &&& close) >>^ fst
A more complicated example (from the same module):
-- | Match one or more occurences of the given parser separated by the sepator. sepBy1 :: MD i o -> MD i o' -> MD i [o] sepBy1 p s = (many (p &&& s >>^ fst) &&& p) >>^ (\(bs,b) -> bs++[b])
4.2 Stream processor
The Lazy K programming language is an interesing esoteric language (from the family of pure, lazy functional languages), whose I/O concept is approached by streams.
4.2.1 Functional I/O, graphical user interfaces
On the Expressiveness of Purely Functional I/O Systems written by Paul Hudak and Raman S. Sundaresh.
4.2.2 Dataflow languages
How these concepts can be implemented using the concept of arrow, can be found in the introductory articles on arrows mentioned above.