[Haskell-cafe] Origins of '$'

Don Stewart dons at galois.com
Sat Dec 6 23:49:34 EST 2008


porges:
> Hello Haskell-Café:
> 
> This is a little bit random, but I was just wondering if anyone knew
> where the $ low-precedence parenthesis-eliminating application operator
> originated. The Haskell Report doesn't mention anything, and I can't
> search for "$" on Google. So... who thought it up? Does it originate in
> an earlier language, or is it uniquely Haskellish? :)
> 

If in doubt, you can search the early archives.

   http://www.cse.unsw.edu.au/~dons/haskell-1990-2006/threads.html 

Early on there is a discussion about using $ for module import
qualifiers,
    
    http://www.cse.unsw.edu.au/~dons/haskell-1990-2006/msg00411.html
    use ' or $ for module qualifiers.  The former would require

But then by 91 we start to see things take shape,

    http://www.cse.unsw.edu.au/~dons/haskell-1990-2006/msg00443.html
    haskell report version 1.1: beta-to-beta2
    Will Partain 

    11 Jun 91 20:41
    - ($$)          :: (a -> b) -> a -> b
    - f $$ a            =  f a

Where '$$' was removed from the draft 1.1 report.

Then  in the following thread we start to see the emergence of the low
fixity $ that we know today. This is the first reference to it that I
can find in the list:

    http://www.cse.unsw.edu.au/~dons/haskell-1990-2006/msg00647.html
    syntax change
    Paul Hudak 

    Sun, 1 Dec 1991 21:16:00 +0000
    About the fixity of $

    | The problem is that V1.1 does not allow things like:
    | 
    | f x $ \y->
    | g y $
    | ...
    | 
    | where the fixity of $ is defined as:
    | 
    | infixr 0 $

Which suggests that $ was already in the 1.0 report going to SIGPLAN.
Perhaps Paul or Simon could shed light on it? Anyone have the 1.0 report
lying around to check if it was in earlier?

Paul reiterates this in Aug 1992,

    http://www.cse.unsw.edu.au/~dons/haskell-1990-2006/msg00889.html

    Of course, if you really don't like the parens, you can always write
    your example as:

      f $ x!i

    where ($) is defined in the prelude as:

      infixr 0 $
      f $ x = f x

-- Don


More information about the Haskell-Cafe mailing list