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? (Ertugrul S?ylemez)
----------------------------------------------------------------------
Message: 1
Date: Wed, 13 Feb 2013 09:12:11 +0100
From: Ertugrul S?ylemez <[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="us-ascii"
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
--
Not to be or to be and (not to be or to be and (not to be or to be and
(not to be or to be and ... that is the list monad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20130213/6d791810/attachment-0001.pgp>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 56, Issue 24
*****************************************