
No, not really
the '.' operator is function composition, so f.g is a new function with f
applied over g.
h=f.g ==> h x = f ( g x )
the '$' is the apply operator, and it applies the right side to the left
side:
h = f $ x ==> h= f ( x )
You can check this looking at their types
(.) :: (b -> c) -> (a -> b) -> a -> c
($) :: (a -> b) -> a -> b
the first one takes two functions and return a new function. The second
takes a function and a value and returns a value.
Regards
Rafael
On Sun, Oct 30, 2011 at 15:39,
Doesn't . and $ do the same thing? I always get confused about that, like when would I use one over the other.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- Rafael Gustavo da Cunha Pereira Pinto