
19 Jun
2008
19 Jun
'08
6:26 a.m.
On Thu, 2008-06-19 at 11:33 +0800, jinjing wrote:
Hi guys,
This is my second attempt to learn Haskell :)
Any way here's the code:
module Dot where import Prelude hiding ( (.) )
(.) :: a -> (a -> b) -> b a . f = f a
infixl 9 .
Note that if you redefine (.) composition to be backward application (flip ($)) then nobody will understand your programs. It's also quite probably that after reading your own code for a while that you'll not understand the code that everyone else writes either! :-) If you want an operator like that, I suggest picking some other symbol. Duncan