
[moved to cafe] Dominic Steinitz wrote:
Taral wrote:
On 5/28/06, Dominic Steinitz
wrote: Is this defined in some library? Thanks, Dominic.
Don't think so. I use:
\a b -> f (g a b)
Taral,
Thanks. What prompted this question is that I find myself writing things like:
foo = ((.).(.)) concat intersperse
Hi Dominic - I hope it's ok for me to ask this question and I'm absolutely burning with curiosity to find out the answer... How did you know to write ((.).(.)) instead of (\f g a b -> f (g a b)) ? Although the correctness of the above translation has been proved, it seems extremely non-obvious to me that to compose a function with another function which takes two arguments you should use the compose function to compose the compose function with itself... Is this kind of composition common in some branch of Lambda calculus? Is it something that I might in time be able to see directly without having to go through a proof? Does anyone else "see" the above translation intuitively and is there a way to imagine it? Thanks, Brian. -- Logic empowers us and Love gives us purpose. Yet still phantoms restless for eras long past, congealed in the present in unthought forms, strive mightily unseen to destroy us. http://www.metamilk.com

brianh:
[moved to cafe] Dominic Steinitz wrote:
Taral wrote:
On 5/28/06, Dominic Steinitz
wrote: Is this defined in some library? Thanks, Dominic.
Don't think so. I use:
\a b -> f (g a b)
Taral,
Thanks. What prompted this question is that I find myself writing things like:
foo = ((.).(.)) concat intersperse
Hi Dominic - I hope it's ok for me to ask this question and I'm absolutely burning with curiosity to find out the answer...
How did you know to write ((.).(.)) instead of (\f g a b -> f (g a b)) ?
If you play with the @pointless plugin in lambdabot http://haskell.org/haskellwiki/Pointfree it becomes almost second nature with practice :) -- Don

Donald Bruce Stewart wrote:
brianh:
How did you know to write ((.).(.)) instead of (\f g a b -> f (g a b)) ?
If you play with the @pointless plugin in lambdabot http://haskell.org/haskellwiki/Pointfree
Thanks for pointing this out :-) I'm reminded of Spock rebuilding his mind with the help of 3 computers in Star Trek IV!!!
it becomes almost second nature with practice :)
Seriously though - this is an interesting way forward. My luddite tendencies always send me towards pencil and paper but iiuc what you're saying is that I should go for the immersive approach and think of it like learning a foreign language, and actually make use of the technology for conceptual development. I'll have to try this out... Best regards, Brian. -- Logic empowers us and Love gives us purpose. Yet still phantoms restless for eras long past, congealed in the present in unthought forms, strive mightily unseen to destroy us. http://www.metamilk.com

Brian Hulley wrote:
Hi Dominic - I hope it's ok for me to ask this question and I'm absolutely burning with curiosity to find out the answer...
How did you know to write ((.).(.)) instead of (\f g a b -> f (g a b)) ?
Brian, I can't remember. I certainly don't find it intuitive. I think it was discussed on the Haskell mailing list a long time ago. Also I had a conversation with someone who pointed out that it's well known in combinatory logic. http://en.wikipedia.org/wiki/Combinatory_logic has a translation scheme from the lambda calculus to combinators. I presume that's how @pointless plugin in lambdabot works. Dominic.

Dominic Steinitz wrote:
Brian Hulley wrote:
Hi Dominic - I hope it's ok for me to ask this question and I'm absolutely burning with curiosity to find out the answer...
How did you know to write ((.).(.)) instead of (\f g a b -> f (g a b)) ?
Brian,
I can't remember. I certainly don't find it intuitive. I think it was discussed on the Haskell mailing list a long time ago. Also I had a conversation with someone who pointed out that it's well known in combinatory logic. http://en.wikipedia.org/wiki/Combinatory_logic has a translation scheme from the lambda calculus to combinators. I presume that's how @pointless plugin in lambdabot works.
Dominic.
Thanks for the link. I think it's fascinating that already with ((.).(.)) there is something that can be used practically and proved equivalent to something easily comprehensible, but is itself perhaps already beyond the range of conscious human comprehension (at least without having to rent a cave in the Himalayas for several centuries... :-) ) Perhaps here is an interesting line of study for anyone psychologically inclined? Certainly it shows how much there is still to explore in terms of the inner landscape of lambda calculus. Best regards, Brian. -- Logic empowers us and Love gives us purpose. Yet still phantoms restless for eras long past, congealed in the present in unthought forms, strive mightily unseen to destroy us. http://www.metamilk.com

On 2006-05-29 at 19:03BST "Brian Hulley" wrote:
Dominic Steinitz wrote:
I think it's fascinating that already with ((.).(.)) there is something that can be used practically and proved equivalent to something easily comprehensible,
Well, it is compose composed with compose, so you can start from the idea that it's going to do something to do with composition and twoness...
Certainly it shows how much there is still to explore in terms of the inner landscape of lambda calculus.
You've read http://www.amazon.co.uk/exec/obidos/ASIN/0444875085/qid=1148927765/sr=1-1/re... I presume? ;-) It's a bestseller... -- Jón Fairbairn Jon.Fairbairn at cl.cam.ac.uk

Jon Fairbairn wrote:
On 2006-05-29 at 19:03BST "Brian Hulley" wrote:
Dominic Steinitz wrote:
I think it's fascinating that already with ((.).(.)) there is something that can be used practically and proved equivalent to something easily comprehensible,
Well, it is compose composed with compose, so you can start from the idea that it's going to do something to do with composition and twoness...
Certainly it shows how much there is still to explore in terms of the inner landscape of lambda calculus.
You've read
http://www.amazon.co.uk/exec/obidos/ASIN/0444875085/qid=1148927765/sr=1-1/re...
I presume? ;-) It's a bestseller...
I must admit I haven't read it... Are you saying that this book contains the knowledge I'd need to form such concepts as to be able to directly comprehend (.).(.) as easily as \f g a b -> f(g a b) ? (since I already know how to manually convert one to the other by a sequence of substitutions but this knowledge alone doesn't help) If so, then I'll buy it... Thanks, Brian. -- Logic empowers us and Love gives us purpose. Yet still phantoms restless for eras long past, congealed in the present in unthought forms, strive mightily unseen to destroy us. http://www.metamilk.com

Brian Hulley wrote:
Jon Fairbairn wrote:
You've read
http://www.amazon.co.uk/exec/obidos/ASIN/0444875085/qid=1148927765/sr=1-1/re...
I presume? ;-) It's a bestseller...
I must admit I haven't read it... Are you saying that this book contains the knowledge I'd need to form such concepts as to be able to directly comprehend (.).(.) as easily as \f g a b -> f(g a b) ? (since I already know how to manually convert one to the other by a sequence of substitutions but this knowledge alone doesn't help)
If so, then I'll buy it...
I think my question above would be rather impossible to answer, so apologies for asking it. Thanks for the recommendation. I've ordered the book (I've wanted a good reference for lambda calculus for a while) and regardless of whether or not it enables me to directly comprehend (.).(.) immediately I'm sure I'll at least learn something worthwhile... Best regards, Brian. -- Logic empowers us and Love gives us purpose. Yet still phantoms restless for eras long past, congealed in the present in unthought forms, strive mightily unseen to destroy us. http://www.metamilk.com

On May 29, 2006, at 9:33 AM, Dominic Steinitz wrote:
Hi Dominic - I hope it's ok for me to ask this question and I'm absolutely burning with curiosity to find out the answer... How did you know to write ((.).(.)) instead of (\f g a b -> f (g a b)) ?
Brian,
I can't remember. I certainly don't find it intuitive. I think it was discussed on the Haskell mailing list a long time ago.
It may have been this thread, where Tom Pledger points out that ($) makes a good "0-ary" case of the progression: http://www.haskell.org/pipermail/haskell/2003-July/012259.html But then it's only 3 years old, so clearly not a "long time ago" :) . -- Fritz PS: In my original posting on that thread, I said that abstracting this out as a fold of compositions over lists of compositions (foldr (.) id (replicate n (.)) was quite difficult for typing reasons. I now realize that Oleg probably does that sort of thing idly doodling on the back of a napkin while he chats on the phone with his other hand. My mistake. :) ---------- From the thread (quoting Tom Pledger quoting me): Tom Pledger wrote:
K. Fritz Ruehr writes: : | But Jerzy Karczmarczuk enlightened me as to the full generality possible | along these lines (revealing the whole truth under the influence of at | least one beer, as I recall). Namely, one can define a sequence of | functions (let's use a better notation now, with "c" for composition): | | c1 = (.) -- good old composition | | c2 = (.) . (.) -- my (.<) from above | | c3 = (.) . (.) . (.) | | c4 = (.) . (.) . (.) . (.) | | -- etc.
Nice!
There's also
c0 = ($)
which is clearer if you use 'non-pointfree' notation
... c2 f g x y = f (g x y) c1 f g x = f (g x) c0 f g = f g
- Tom
participants (5)
-
Brian Hulley
-
Dominic Steinitz
-
dons@cse.unsw.edu.au
-
Fritz Ruehr
-
Jon Fairbairn