Functional Programming and python

rusi rustompmody at gmail.com
Tue Sep 24 11:07:55 EDT 2013


On Tuesday, September 24, 2013 8:21:19 PM UTC+5:30, Jussi Piitulainen wrote:
> Would the type system get in the way of providing some analogous
> function in Haskell? I don't know.

Yes.
The haskell curry
curry f x y = f (x,y)
is really only curry2
curry3 would be
curry3 f x y z = f (x,y,z)
and so on upwards

Vanilla Haskell makes it real hard to put all these under one type umbrella

By comparison python's partial is quite effortless.

And this is an old conundrum in programming language design:

In C printf is easy to write and NOT put into the language but into external libraries
In Pascal, writeln cannot be outside the language because as a user defined function, its type would not fit the type system.

And so printf can be made to crash quite easily; not so writeln!



More information about the Python-list mailing list