On Thu, Jun 19, 2008 at 3:35 AM, Ketil Malde <
ketil@malde.org> wrote:
jinjing <
nfjinjing@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.
-Brent