Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: f . g or f g or f $ g? (Mateusz Kowalczyk)
----------------------------------------------------------------------
Message: 1
Date: Wed, 13 Feb 2013 17:50:14 +0000
From: Mateusz Kowalczyk <[email protected]>
Subject: Re: [Haskell-beginners] f . g or f g or f $ g?
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Oops, you're right. Sorry for my oversight.
On 13/02/13 08:12, Ertugrul S?ylemez wrote:
> Mateusz Kowalczyk <[email protected]> wrote:
>
>> A less obvious interpretation is to treat ($) as `id'.
>>
>> (f . g) x = f $ g x = f (id g x) = f (g x)
>
> This is not how you get from ($) to id. The correct path is:
>
> f $ x = ($) f x = f x = id f x = f `id` x
>
> This equivalence is indicated by the type of ($). It's a specialized
> instance of a -> a:
>
> ($) :: (a -> b) -> (a -> b)
> ($) f = f
>
> or equivalently:
>
> ($) :: (a -> b) -> a -> b
> ($) f x = f x
>
> or equivalently:
>
> ($) :: (a ~ b -> c) => a -> a
> ($) = id
>
>
> Greets,
> Ertugrul
>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 56, Issue 26
*****************************************