Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

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 <fuuze...@fuuzetsu.co.uk>
Subject: Re: [Haskell-beginners] f . g or f g  or f $ g?
To: beginners@haskell.org
Message-ID: <511bd256.5060...@fuuzetsu.co.uk>
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 <fuuze...@fuuzetsu.co.uk> 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
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
> 



------------------------------

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 56, Issue 26
*****************************************

Reply via email to