## A new notation for arrows (2001)

Venue: | In International Conference on Functional Programming (ICFP ’01 |

Citations: | 48 - 1 self |

### BibTeX

@INPROCEEDINGS{Paterson01anew,

author = {Ross Paterson},

title = {A new notation for arrows},

booktitle = {In International Conference on Functional Programming (ICFP ’01},

year = {2001},

pages = {229--240},

publisher = {ACM}

}

### Years of Citing Articles

### OpenURL

### Abstract

The categorical notion of monad, used by Moggi to structure denotational descriptions, has proved to be a powerful tool for structuring combinator libraries. Moreover, the monadic programming style provides a convenient syntax for many kinds of computation, so that each library defines a new sublanguage. Recently, several workers have proposed a generalization of monads, called variously “arrows ” or Freyd-categories. The extra generality promises to increase the power, expressiveness and efficiency of the embedded approach, but does not mesh as well with the native abstraction and application. Definitions are typically given in a point-free style, which is useful for proving general properties, but can be awkward for programming specific instances. In this paper we define a simple extension to the functional language Haskell that makes these new notions of computation more convenient to use. Our language is similar to the monadic style, and has similar reasoning properties. Moreover, it is extensible, in the sense that new combining forms can be defined as expressions in the host language. 1.

### Citations

785 |
The semantics of a simple language for parallel programming
- Kahn
- 1974
(Show Context)
Citation Context ...y to the graphical presentation given earlier. The variables denote the values passing through wires on a particular clock tick. 6.2 Interpretations One implementation uses an idea introduced by Kahn =-=[17]-=-: components define functions from infinite sequences of inputs to infinite sequences of outputs. This idea is the basis for several data-flow languages [2, 6, 29], for which hardware simulation is ju... |

671 | The esterel synchronous programming language : design, semantics, implementation. Rapport de recherche RR-842
- Berry, Gonthier
- 1988
(Show Context)
Citation Context ...tick may depend on the input for that tick, as well as previous inputs. Such circuits fit well with the data-flow model of computation, and several languages of that type have been used to model them =-=[2, 6, 29]-=-.Consider the following simple circuit (taken from [20]): ☛ ✡ CONST 0 ✟ ✠ next ☛ ✲ ✡ ☛ ✡ reset ❄ ✟ ✠ COND DELAY 0 ✟ ✛ ✠ out ☛ ❄ INCR ✡ ✲ ✟ ✠ This circuit represents a resettable counter, taking a Boo... |

501 | Sorting networks and their applications
- Batcher
- 1968
(Show Context)
Citation Context ...similar structure.) Some examples of butterflies: rev :: Hom a a rev = butterfly swap unriffle :: Hom (Pair a) (Pair a) unriffle = butterfly transpose Batcher’s ingenious sorter for bitonic sequences =-=[1]-=- is another example of a butterfly circuit: bisort :: Ord a ⇒ Hom a a bisort = butterfly cmp where cmp (x, y) = (min x y, max x y) This can be used (with rev) as the merge phase of a sorting function.... |

440 | Computational lambda-calculus and monads
- Moggi
- 1989
(Show Context)
Citation Context ...ves a recent account. Many of these libraries or sublanguages have a common structure; they involve a monad, a categorical structure that Moggi applied to the structuring of denotational descriptions =-=[22]-=- and Wadler subsequently applied to functional programming [30]. Much useful code can be written to the monad abstraction, and is thus useful with each such library. In the monad-based view of computa... |

272 | Parallel prefix computation
- Ladner, Fischer
- 1980
(Show Context)
Citation Context ...→ ... where b is the identity of the ⊕ operation 1 . The missing part will be defined using recursive calls of scan, but operating on smaller trees. An efficient scheme, devised by Ladner and Fischer =-=[18]-=-, is first to sum the elements pairwise: x0 ⊕ x1, x2 ⊕ x3, x4 ⊕ x5, . . . and then to compute the scan of this list (which is half the length of the original), yielding x0 ⊕ x1, x0 ⊕ x1 ⊕ x2 ⊕ x3, x0 ... |

249 | Lustre / A declarative language for programming synchronous systems
- Halbwachs, Caspi, et al.
- 1967
(Show Context)
Citation Context ...tick may depend on the input for that tick, as well as previous inputs. Such circuits fit well with the data-flow model of computation, and several languages of that type have been used to model them =-=[2, 6, 29]-=-.Consider the following simple circuit (taken from [20]): ☛ ✡ CONST 0 ✟ ✠ next ☛ ✲ ✡ ☛ ✡ reset ❄ ✟ ✠ COND DELAY 0 ✟ ✛ ✠ out ☛ ❄ INCR ✡ ✲ ✟ ✠ This circuit represents a resettable counter, taking a Boo... |

179 |
The next 700 programming languages
- Landin
- 1966
(Show Context)
Citation Context ...TION A useful method for implementing of domain-specific languages (DSLs) is to embed them in a general-purpose language. Functional languages are particularly suitable, as originally noted by Landin =-=[19]-=- and widely exploited since. Hudak [11] gives a recent account. Many of these libraries or sublanguages have a common structure; they involve a monad, a categorical structure that Moggi applied to the... |

165 |
Traced monoidal categories
- Joyal, Street, et al.
- 1996
(Show Context)
Citation Context ...the sliding axiom, in which arbitrary circuits could be moved around the loop. 5.1 Theoretical Aside The simple loop operator is an example of a trace operator, as defined by Joyal, Street and Verity =-=[16, 10]-=-. Their definition assumed a braided monoidal category (a relaxation of a symmetric monoidal category). The equations of Figure 7 generalize their axioms to Freyd-categories, and the names of all but ... |

160 | Generalising monads to arrows
- Hughes
- 2000
(Show Context)
Citation Context ...uld be lost in any definition of the >= combinator. Moreover, as they noted, this optimization technique is applicable in many other contexts, but the resulting libraries would not be monadic. Hughes =-=[12]-=- showed that monads could be generalized to “arrows” relating inputs and outputs. Workers in denotational semantics have proposed similar frameworks [4, 26, 27]. Such arrows may represent “procedures”... |

121 | Modular domain specific languages and tools
- Hudak
- 1998
(Show Context)
Citation Context ...f domain-specific languages (DSLs) is to embed them in a general-purpose language. Functional languages are particularly suitable, as originally noted by Landin [19] and widely exploited since. Hudak =-=[11]-=- gives a recent account. Many of these libraries or sublanguages have a common structure; they involve a monad, a categorical structure that Moggi applied to the structuring of denotational descriptio... |

113 | Lava: hardware design in haskell
- Bjesse, Claessen, et al.
- 1998
(Show Context)
Citation Context ...h more abstract descriptions, and also allowing the same circuit description to be simulated or symbolically executed. Further interpretations are possible with the hardware description language Lava =-=[3]-=-, where circuits have the form V alue → Monad V alue ′ where both value and monad types are parameters described by Haskell classes. By selecting appropriate instances, a single description may be sim... |

99 | Premonoidal categories and notions of computation
- Power, Robinson
- 1997
(Show Context)
Citation Context ...sulting libraries would not be monadic. Hughes [12] showed that monads could be generalized to “arrows” relating inputs and outputs. Workers in denotational semantics have proposed similar frameworks =-=[4, 26, 27]-=-. Such arrows may represent “procedures” that have a static component independent of the input, or other kinds of procedure that accept multiple inputs, as well as monadic computations. The added gene... |

77 | Fudgets – a graphical user interface in a lazy functional language
- Carlsson, Hallgren
- 1993
(Show Context)
Citation Context ...r and Robinson call a notion of computation [26]. Even more general structures have been explored by Blute, Cockett and Seely [4]. Hughes [12] showed that the stream processors of the Fudgets library =-=[5]-=- comprised an arrow type, but were more often used as a dual arrow type. In Power and Robinson’s terms, stream processors comprise a notion of computation where the underlying monoidal structure is th... |

59 | Powerlist: A structure for parallel recursion
- Misra
- 1994
(Show Context)
Citation Context ...ase: algorithms operating on 2 n elements, whose behaviour is defined by induction on n. These arise in circuit design (cf. Ruby [15]), and descriptions of parallel algorithms (cf. Misra’s powerlists =-=[21]-=-). The objects of interest then consist of infinite sequences of functions on arrays of increasing size ∞Y a 2n → b 2n n=0 We can model a 2n as Pair n a, where type Pair a = (a, a) Thus the elements a... |

57 | Deterministic, error-correcting combinator parsers - SWIERSTRA, DUPONCHEEL - 1996 |

56 | Monadic parsing in Haskell
- Hutton, Meijer
- 1998
(Show Context)
Citation Context ...t ≫ v) Now we can rewrite the arrow parser of Figure 2, obtaining the version of Figure 4. As promised, the form of this program is very similar to what we would write with monadic parser combinators =-=[13]-=-. The point is that this program works not merely for monadic parsers but also for any parser that can be cast in the more general arrow form, including the optimized ones of Swierstra and Duponcheel ... |

45 | Recursion from cyclic sharing: traced monoidal categories and models of cyclic lambda-calculi
- Hasegawa
- 1997
(Show Context)
Citation Context ...the sliding axiom, in which arbitrary circuits could be moved around the loop. 5.1 Theoretical Aside The simple loop operator is an example of a trace operator, as defined by Joyal, Street and Verity =-=[16, 10]-=-. Their definition assumed a braided monoidal category (a relaxation of a symmetric monoidal category). The equations of Figure 7 generalize their axioms to Freyd-categories, and the names of all but ... |

43 | Recursive monadic bindings
- Erkök, Launchbury
- 2000
(Show Context)
Citation Context ...t would generalize the fixed point operator on monads, which has signature class Monad m ⇒ MonadFix m where mfix :: (a → m a) → m a An axiomatization of this operator is given by Erkök and Launchbury =-=[8]-=-. Not all monads have such an operator, but several important ones do, including state transformers, readers, writers and Haskell’s built-in monads ST and IO. The straightforward generalization of mfi... |

34 | On embedding a microarchitectural design language within Haskell
- Lewis, Cook
(Show Context)
Citation Context ...s inputs. Such circuits fit well with the data-flow model of computation, and several languages of that type have been used to model them [2, 6, 29].Consider the following simple circuit (taken from =-=[20]-=-): ☛ ✡ CONST 0 ✟ ✠ next ☛ ✲ ✡ ☛ ✡ reset ❄ ✟ ✠ COND DELAY 0 ✟ ✛ ✠ out ☛ ❄ INCR ✡ ✲ ✟ ✠ This circuit represents a resettable counter, taking a Boolean input and producing an integer output, which will b... |

27 |
et al. Haskell 98: A non-strict, purely functional language
- Jones, Hughes
- 1999
(Show Context)
Citation Context ...s or to redistribute to lists, requires prior specific permission and/or a fee. ICFP’01, September 3–5, 2001, Florence, Italy. Copyright 2001 ACM 1-58113-415-0/01/0009 ...$5.00. the following Haskell =-=[24]-=- function that adds the results of two computations: addM :: Monad m ⇒ m Int → m Int → m Int u ‘addM ‘ v = u >= λx → v >= λy → return (x + y) Though the setting is more general, variables like x and y... |

25 | Designing Arithmetic Circuits by Refinement in Ruby
- Jones, Sheeran
- 1992
(Show Context)
Citation Context ...ons supported by a particular model. Here we shall focus on a special case: algorithms operating on 2 n elements, whose behaviour is defined by induction on n. These arise in circuit design (cf. Ruby =-=[15]-=-), and descriptions of parallel algorithms (cf. Misra’s powerlists [21]). The objects of interest then consist of infinite sequences of functions on arrays of increasing size ∞Y a 2n → b 2n n=0 We can... |

23 |
Reactive Objects and Functional Programming
- Nordlander
- 1999
(Show Context)
Citation Context ...on We could use the loop operator directly, but is is more convenient to add recursive bindings to our do-notation, as foreshadowed in Figure 5. We use a form modelled on the recursive let (O’Haskell =-=[23]-=- has a similar notation for monadic do), rather than the recursive do of Erkök and Launchbury. This form is more flexible, and has a simple correspondence to loop, given by the following translation r... |

16 | Collecting Butterflies
- Jones, Sheeran
- 1991
(Show Context)
Citation Context ...roc (x, y) → do yl ← rsh b −≺ y returnA −≺ (yl, x) Butterfly Circuits. In many divide-and-conquer schemes, one recursive call processes the odd-numbered elements and the other processes the even ones =-=[14]-=-: butterfly :: (Pair a → Pair a) → Hom a a butterfly f = id :&: proc (x, y) → do x ′ ← butterfly f −≺ x y ′ ← butterfly f −≺ y returnA −≺ f (x ′ , y ′ ) The recursive calls operate on halves of the or... |

14 |
Fibrational control structures
- Hermida, Power
- 1995
(Show Context)
Citation Context ..., D) ∼ = HA×B(C, D) as in Hasegawa’s κ-calculus [9]. A control operator defines a natural family of functions, one for each category HA. These generalize the controls of elementary control structures =-=[25]-=-, which are used to model concurrency. Our definition suggests a higher-order generalization, although such operators appear to be less useful. 3.4 Type-checking of Commands One could use the equation... |

11 |
Closed Freyd- and kappa-categories
- Power, Thielecke
- 1999
(Show Context)
Citation Context ...sulting libraries would not be monadic. Hughes [12] showed that monads could be generalized to “arrows” relating inputs and outputs. Workers in denotational semantics have proposed similar frameworks =-=[4, 26, 27]-=-. Such arrows may represent “procedures” that have a static component independent of the input, or other kinds of procedure that accept multiple inputs, as well as monadic computations. The added gene... |

9 | A taxonomy of functional language implementations. Part II: call-byname, call-by-need, and graph reduction. INRIA research report 3050
- Douence, Fradet
- 1996
(Show Context)
Citation Context ...nnamed. The next form, the κ quantifier, applies another pattern to the innermost argument v1 within a sub-command. A similar quantifier occurs in the abstract machine framework of Douence and Fradet =-=[7]-=-, transferring a value from the argument stack to the environment. Thus we can write a command like c1 ‘handleA‘ κ ex → c2 This may be read just like the corresponding monadic form: the body c1 is exe... |

8 | Decomposing typed lambda calculus into a couple of categorical programming languages
- Hasegawa
- 1995
(Show Context)
Citation Context ...tegories, with A corresponding to the input context and B to additional arguments. The κ quantifier then corresponds to the obvious isomorphism HA(B × C, D) ∼ = HA×B(C, D) as in Hasegawa’s κ-calculus =-=[9]-=-. A control operator defines a natural family of functions, one for each category HA. These generalize the controls of elementary control structures [25], which are used to model concurrency. Our defi... |

4 | Categories for computation in context and unified logic
- Blute, Cockett, et al.
- 1997
(Show Context)
Citation Context ...sulting libraries would not be monadic. Hughes [12] showed that monads could be generalized to “arrows” relating inputs and outputs. Workers in denotational semantics have proposed similar frameworks =-=[4, 26, 27]-=-. Such arrows may represent “procedures” that have a static component independent of the input, or other kinds of procedure that accept multiple inputs, as well as monadic computations. The added gene... |