[Haskell] (.) . (.)

Christophe Poucet christophe.poucet at gmail.com
Sun May 28 16:39:16 EDT 2006


Hello,

I think you look at the (.) . (.) as all being c's in the wrong way. You 
have to consider what will evaluate first (syntactical priority rules). 
Anyways the simplest case that this is equivalent can be seen here:
22:33 < vincenz> @pl \f g a b -> f (g a b)
22:33 < lambdabot> (.) . (.)

Writing it explicilty:
(.) f g a = f (g a)


so we get
(.) . (.) = \f -> (.) ((.) f)
(.) . (.) f = (.) ((.) f)
(.) . (.) f g = (.) ((.) f) g
(.) . (.) f g = ((.) f) . g
(.) . (.) f g a = ((.) f) (g a)
(.) . (.) f g a = (.) f (g a)
(.) . (.) f g a = f . (g a)
(.) . (.) f g a b = f . (g a) $ b
(.) . (.) f g a b = f ((g a) b)
(.) . (.) f g a b = f (g a b)

Cheers
Christophe

Brian Hulley wrote:

> Brian Hulley wrote:
>
>> Taral wrote:
>>
>>> On 5/28/06, Dominic Steinitz <dominic.steinitz at blueyonder.co.uk>
>>> wrote:
>>>
>>>> Is this defined in some library? Thanks, Dominic.
>>>
>>>
>>> Don't think so. I use:
>>>
>>> \a b -> f (g a b)
>>
>>
>> I don't see how (.) . (.) translates into something so simple.
>> Using c for (.) to make things easier to write, I get:
>>
>> (.) . (.)
>> === c c c
>> === \x -> (c c c x)
>> === \x -> (c (c x))
>> === \x -> (\y z -> c (c x) y z)
>
>
> Here was one error ^^^^
> so fixing it and continuing:
>
> \x -> (c (c x))
> === \x -> (\y z -> c (c x) z y)
> === \x -> (\y z -> (c x) (z y))
> === \x -> (\y z -> (\p q -> c x q p) (z y))
> === \x -> (\y z -> (\p q -> x (q p)) (z y))
> === \x -> (\y z -> (\q -> x (q (z y))))
>
> === \x y z q -> x (q (z y))
>
> But it still doesn't match f (g a b)...
>
> Regards, Brian.
> _______________________________________________
> Haskell mailing list
> Haskell at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>


-- 
Christophe Poucet
Ph.D. Student
Phone:+32 16 28 87 20
E-mail: Christophe (dot) Poucet (at) imec (dot) be
Website: http://notvincenz.com/  
IMEC vzw – Register of Legal Entities Leuven VAT BE 0425.260.668 – Kapeldreef 75, B-3001 Leuven, Belgium – www.imec.be
*****DISCLAIMER*****
This e-mail and/or its attachments may contain confidential information. It is intended solely for the intended addressee(s).
Any use of the information contained herein by other persons is prohibited. IMEC vzw does not accept any liability for the contents of this e-mail and/or its attachments.
**********



More information about the Haskell mailing list