RE: [Haskell-cafe] Function application like a Unix pipe

Henning Thielemann
I want to say, that the order of symbols for ($), (.) and function application is consistent. This is a fine thing. I think that shall not be distroyed by giving ($) and (.) reversed argument order.
I see. I like the argument order also, since it so nicely reflects mathematical notation. But I do think there's a place for (flip ($)) and (flip (.)). The problem is that the assignment of fixities is much more subtle and requires a consideration of what should be considered "proper style". Chad Scherrer Computational Mathematics Group Pacific Northwest National Laboratory "Time flies like an arrow; fruit flies like a banana." -- Groucho Marx

On Wed, 2005-11-23 at 08:55 -0800, Scherrer, Chad wrote: . . .
I see. I like the argument order also, since it so nicely reflects mathematical notation. But I do think there's a place for (flip ($)) and (flip (.)). The problem is that the assignment of fixities is much more subtle and requires a consideration of what should be considered "proper style".
Interesting note: in Richard Bird and Oege de Moor, _Algebra of Programming_, pp. 2-3, the authors write As a departure from tradition, we write "f : A <- B" rather than "f : B -> A" to indicate the source and target types associated with a function "f". ... The reason for this choice has to do with functional composition, whose definition now takes the smooth form: if f : A <- B and g : B <- C, then f . g : A <- C is defined by (f . g) x = f(g x). Further along the same paragraph they write: In the alternative, so-called diagrammatic forms, one writes "x f" for application and "f ; g" for composition, where x (f ; g) = (x f) g. I know I've read about the latter notation as one used by some algebraists, but I can't put my hands on a source right now. I guess it's not even entirely clear what constitutes "mathematical notation". :-) -- Bill Wood
participants (2)
-
Bill Wood
-
Scherrer, Chad