[Haskell-cafe] message passing style like in Haskell?

Derek Elkins derek.a.elkins at gmail.com
Thu Jun 19 21:53:54 EDT 2008


On Thu, 2008-06-19 at 15:24 -0400, Brent Yorgey wrote:
> 
> On Thu, Jun 19, 2008 at 3:35 AM, Ketil Malde <ketil at malde.org> wrote:
>         jinjing <nfjinjing at gmail.com> writes:
>         
>         > Any way here's the code:
>         
>         > module Dot where
>         > import Prelude hiding ( (.) )
>         
>         > (.) :: a -> (a -> b) -> b
>         > a . f = f a
>         
>         > infixl 9 .
>         
>         
>         Isn't this (roughly?) the same as flip ($)?
>         
>         As a side note, may I advise you to use another symbol, and
>         leave the
>         poor dot alone? Overloading it as a module separator is bad
>         enough.
>         If you have a keyboard that allows greater-than-ascii input,
>         there are
>         plenty of options: « » ¡ £ ¥ ł € ® ª...

> 
> Note that there already is a standard symbol for this, (>>>) from
> Control.Arrow.  Well, actually (>>>) is more general than backwards
> function composition, so maybe making your own symbol is still a good
> idea while you're learning.

Application, not composition.  Cont's return would work if it weren't
for the wrapping.  Similarly, (>>=) for the Id monad.
> 



More information about the Haskell-Cafe mailing list