[Haskell-cafe] Function application like a Unix pipe

Scherrer, Chad Chad.Scherrer at pnl.gov
Wed Nov 23 14:43:22 EST 2005


Bill Wood <william.wood3 at comcast.net> writes:

> 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

Good point. One of my undergrad algebra books ("Contemporary Abstract
Algebra", by Gallian) actually used notation like this. Function
application was written (x f). Some people even write the function as an
exponential. But (f x) is still far more common.

Chad Scherrer
Computational Mathematics Group
Pacific Northwest National Laboratory

"Time flies like an arrow; fruit flies like a banana." -- Groucho Marx 


More information about the Haskell-Cafe mailing list