Programming with arrows

  • Authors:
  • John Hughes

  • Affiliations:
  • Department of Computer Science and Engineering, Chalmers University of Technology, Göteborg, Sweden

  • Venue:
  • AFP'04 Proceedings of the 5th international conference on Advanced Functional Programming
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Consider this simple Haskell definition, of a function which counts the number of occurrences of a given word w in a string: count w = length . filter (==w) . words This is an example of “point-free” programming style, where we build a function by composing others, and make heavy use of higher-order functions such as filter. Point-free programming is rightly popular: used appropriately, it makes for concise and readable definitions, which are well suited to equational reasoning in the style of Bird and Meertens [2]. It’s also a natural way to assemble programs from components, and closely related to connecting programs via pipes in the UNIX shell.