On Fri, Jul 31, 2009 at 5:53 AM, Ryan Ingram<[email protected]> wrote:

> Read ($) as a parenthesis that extends as far to the right as
> possible; so you can write, for example:

That doesn't always work, for example :

map (+2) . map (*1) $ [1,2,3]
= [4,6,8]

Now replacing the $ by a parenthesis that extends as far to the right
as possible :

map (+2) . map (*1) ( [1,2,3] )

<interactive>:1:11:
    Couldn't match expected type `a -> [a1]'
           against inferred type `[a2]'
    In the second argument of `(.)', namely `map (* 2) ([1, 2, 3])'
    In the expression: map (+ 2) . map (* 2) ([1, 2, 3])
    In the definition of `it': it = map (+ 2) . map (* 2) ([1, 2, 3])
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to