Re: Functional programming in Python

2001-05-29 Thread Jerzy Karczmarczuk
Marcin Kowalczyk: BTW, before I knew Haskell I exprimented with a syntax in which 'x f' is the application of 'f' to 'x', and 'x f g' means '(x f) g'. Other arguments can also be on the right, but in this case with parentheses, e.g. 'x f (y)' is a function f applied to two arguments. Hmmm.

Re: Functional programming in Python

2001-05-29 Thread Ketil Malde
Jerzy Karczmarczuk [EMAIL PROTECTED] writes: BTW, before I knew Haskell I exprimented with a syntax in which 'x f' is the application of 'f' to 'x', and 'x f g' means '(x f) g'. Hmmm. An experimental syntax, you say... Oh, say, you reinvented FORTH? Wouldn't x f g in a Forth'ish

Re: Functional programming in Python

2001-05-29 Thread Brook Conner
On Tuesday, May 29, 2001, at 04:44 PM, Ketil Malde wrote: Jerzy Karczmarczuk [EMAIL PROTECTED] writes: Wouldn't x f g in a Forth'ish machine mean g(f,x) -- using standard math notation, for a change rather than g(f(x)) ? In PostScript, a Forth derivative, it

Re: Functional programming in Python

2001-05-29 Thread Marcin 'Qrczak' Kowalczyk
29 May 2001 22:44:38 +0200, Ketil Malde [EMAIL PROTECTED] pisze: Wouldn't x f g in a Forth'ish machine mean g(f,x) -- using standard math notation, for a change rather than g(f(x)) ? It depends whether f changes the value at top of the stack or only puts

RE: Functional programming in Python

2001-05-28 Thread Malcolm Wallace
It seems that right-associativity is so intuitive that even the person proposing it doesn't get it right. :-) Partial applications are a particular problem: Haskell Non-Haskell Left Associative Right Associative From

Re: Functional programming in Python

2001-05-25 Thread Zhanyong Wan
S. Alexander Jacobson wrote: Does anyone know why the haskell designers did not make the syntax right associative? It would clean up a lot of stuff. Haskell Non-Haskell Left AssociativeRight Associative foo (bar (baz (x)))

Re: Functional programming in Python

2001-05-25 Thread Juan Carlos Arevalo Baeza
At 05:25 PM 5/25/2001 -0400, S. Alexander Jacobson wrote: Admittedly, this is different from how haskell type checks now. I guess the question is whether it is impossible to type check or whether it just requires modification to the type checking algorithm. Does anyone know? I don't think

Re: Functional programming in Python

2001-05-24 Thread Peter Hancock
Hi, you said Unfortunately in many cases you need to apply nearly as many parens for a Haskell expression as you would for a Python one, but they're in different places. It's not: foo( bar( baz( x ) ) ) it's: (foo ( bar (baz x) ) ) Clearly the

RE: Functional programming in Python

2001-05-24 Thread Tom Pledger
Peter Douglass writes: : | but in ( foo ( bar (baz x) ) ) | | You would want the following I think. | | foo . bar . baz x | | which does have the parens omitted, but requires the composition | operator. Almost. To preserve the meaning, the composition syntax would need to be

Re: Functional programming in Python

2001-05-22 Thread Manuel M. T. Chakravarty
Pertti Kellomäki [EMAIL PROTECTED] wrote, From: Ketil Malde [EMAIL PROTECTED] Manuel M. T. Chakravarty [EMAIL PROTECTED] writes: You want to be able to write f 1 2 + g 3 4 instead of (f 1 2) + (g 3 4) I do? Personally, I find it a bit confusing, and I still

Re: Functional programming in Python

2001-05-22 Thread Arjan van IJzendoorn
For humans, it is quite natural to use visual cues (like layout) to indicate semantics. I agree, but let us not try to do that with just two (already overloaded) symbols. (let ((a 0) (b 1)) (+ a b)) let { a = 0; b = 1; } in a + b is valid Haskell and the way I use

Re: Functional programming in Python

2001-05-22 Thread Kellomaki Pertti
I realize this is a topic where it would be very easy to start a flame war, but hopefully we can avoid that. Paul Hudak wrote: Why not have your tool generate layout-less code? Surely that would be easier to program, and be less error prone. The tool in question is Happy, and the error

Re: Functional programming in Python

2001-05-20 Thread Ketil Malde
Manuel M. T. Chakravarty [EMAIL PROTECTED] writes: You want to be able to write f 1 2 + g 3 4 instead of (f 1 2) + (g 3 4) I do? Personally, I find it a bit confusing, and I still often get it wrong on the first attempt. The good thing is that the rule is simple to remember. :-)

RE: Functional programming in Python

2001-05-09 Thread Manuel M. T. Chakravarty
of writing a simple program that did a few simple imperative things inordinately difficult. I know about the 'do' construct, and I understand the difference between and =. I've read a book on Haskell, and implemented functional programming support for Python, but trying to use Haskell to write complete

RE: Functional programming in Python

2001-05-08 Thread brk
difficult. I know about the 'do' construct, and I understand the difference between and =. I've read a book on Haskell, and implemented functional programming support for Python, but trying to use Haskell to write complete programs still ties my brain in knots. I see there are people writing complete

Re: Functional programming in Python

2001-05-08 Thread Erik Meijer
simple imperative things inordinately difficult. I know about the 'do' construct, and I understand the difference between and =. I've read a book on Haskell, and implemented functional programming support for Python, but trying to use Haskell to write complete programs still ties my brain

Functional programming in Python

2001-05-06 Thread Manuel M. T. Chakravarty
Two quite interesting articles about FP in Python are over at IBM developerWorks: http://www-106.ibm.com/developerworks/library/l-prog.html http://www-106.ibm.com/developerworks/library/l-prog2.html Two IMHO interesting things to note are the following: * In Part 1, at the start, there is