FAQ
Hello all,

I have released version 0.5 of my functional module, a collection of
higher-order and functional programming tools for Python. Currently
offered are tools for function composition, partial function
application, plus flip, foldl, foldr, scanl and scanr functions.

Two version of the release are available: one is written in pure
Python and aims for maximum readability and portability. The other is
coded as a C extension module and is focused on raw performance.

Where to get it:
#########

functional is available at

http://oakwinter.com/code/functional/

and from the Python Package Index at

http://cheeseshop.python.org/pypi/functional.

Both source tarballs and Python Eggs are available for both the pure
Python and C releases. I'm open to user-contributed RPM, Deb or other
packagings.

Release Notes
########

The biggest news in this release is the addition of the C
implementation. Also, a number of functions were removed, as I had
unknowingly duplicated a lot of functionality from the itertools
module.

As always, feedback welcome!

Collin Winter

Search Discussions

  • Bonono at Feb 11, 2006 at 3:57 am

    Collin Winter wrote:
    As always, feedback welcome!
    Any specific reason flip only flip the first 2 arguments rather than
    the whole tuple ?

    That is, I would like to see:

    assert(f(a,b,c, d) == flip(f)(d, c, b, a))
  • Collin Winter at Feb 12, 2006 at 6:08 am

    On 10 Feb 2006 19:57:48 -0800, bonono at gmail.com wrote:
    Collin Winter wrote:
    As always, feedback welcome!
    Any specific reason flip only flip the first 2 arguments rather than
    the whole tuple ?

    That is, I would like to see:

    assert(f(a,b,c, d) == flip(f)(d, c, b, a))
    Because that's what I'm used to from Haskell and other functional
    languages : ) I'll see what I can do about having it flip all
    arguments in the next release.

    Thanks,
    Collin Winter
  • Bonono at Feb 12, 2006 at 6:27 am

    Collin Winter wrote:
    On 10 Feb 2006 19:57:48 -0800, bonono at gmail.com wrote:

    Collin Winter wrote:
    As always, feedback welcome!
    Any specific reason flip only flip the first 2 arguments rather than
    the whole tuple ?

    That is, I would like to see:

    assert(f(a,b,c, d) == flip(f)(d, c, b, a))
    Because that's what I'm used to from Haskell and other functional
    languages : ) I'll see what I can do about having it flip all
    arguments in the next release.
    Thanks for looking into it.

    BTW, I do a quick test on the C version(supposed to be faster) and
    found something interesting:

    Your partial implementation is slower than new.instancemethod(func,
    arg, object), may be you would like to have some micro optimization to
    use that instead for the special case(and I believe over 70% of the
    case) of :

    partial(func, arg)

    Another thing I am wondering is if a compose_m(which means
    f(*g(*arg,**kw)) ) is desirable as that would give me a choice if I
    want to expand the result of g(if it is a tuple) to multi-argument
    rather than single tuple. This is not a problem in Haskell which is
    fully curried but python in general is not. Another option may be a
    helper function like unpack in lua. So I can do compose(compose(f,
    unpack), g) which means f(unpack(g(*arg,**kw))).
  • Neal Becker at Feb 11, 2006 at 4:06 pm
    I just installed from .tar.gz on fedora FC5 x86_64. I ran into 1 small
    problem:

    sudo python setup.py install --verbose
    running install
    running bdist_egg
    running egg_info
    writing functional.egg-info/PKG-INFO
    writing top-level names to functional.egg-info/top_level.txt
    reading manifest file 'functional.egg-info/SOURCES.txt'
    writing manifest file 'functional.egg-info/SOURCES.txt'
    installing library code to build/bdist.linux-x86_64/egg
    running install_lib
    running build_ext
    creating build/bdist.linux-x86_64/egg
    copying build/lib.linux-x86_64-2.4/functional.so ->
    build/bdist.linux-x86_64/egg
    creating stub loader for functional.so
    byte-compiling build/bdist.linux-x86_64/egg/functional.py to functional.pyc
    creating build/bdist.linux-x86_64/egg/EGG-INFO
    writing functional.egg-info/native_libs.txt
    copying functional.egg-info/SOURCES.txt ->
    build/bdist.linux-x86_64/egg/EGG-INFO
    copying functional.egg-info/native_libs.txt ->
    build/bdist.linux-x86_64/egg/EGG-INFO
    copying functional.egg-info/PKG-INFO ->
    build/bdist.linux-x86_64/egg/EGG-INFO
    copying functional.egg-info/top_level.txt ->
    build/bdist.linux-x86_64/egg/EGG-INFO
    copying functional.egg-info/zip-safe ->
    build/bdist.linux-x86_64/egg/EGG-INFO
    creating 'dist/functional-0.5-py2.4-linux-x86_64.egg' and adding
    'build/bdist.linux-x86_64/egg' to it
    removing 'build/bdist.linux-x86_64/egg' (and everything under it)
    Processing functional-0.5-py2.4-linux-x86_64.egg
    Removing /usr/lib64/python2.4/site-packages/functional-0.5-py2.4-linux-x86_64.egg
    Copying functional-0.5-py2.4-linux-x86_64.egg
    to /usr/lib64/python2.4/site-packages

    Installed /usr/lib64/python2.4/site-packages/functional-0.5-py2.4-linux-x86_64.egg

    Because this distribution was installed --multi-version or --install-dir,
    before you can import modules from this package in an application, you
    will need to 'import pkg_resources' and then use a 'require()' call
    similar to one of these examples, in order to select the desired version:

    pkg_resources.require("functional") # latest installed version
    pkg_resources.require("functional==0.5") # this exact version
    pkg_resources.require("functional>=0.5") # this version or higher

    Processing dependencies for functional==0.5

    What's all this about multi-version? Did I do something wrong?
  • Collin Winter at Feb 12, 2006 at 6:06 am

    On 2/11/06, Neal Becker wrote:
    I just installed from .tar.gz on fedora FC5 x86_64. I ran into 1 small
    problem: [snip]
    Because this distribution was installed --multi-version or --install-dir,
    before you can import modules from this package in an application, you
    will need to 'import pkg_resources' and then use a 'require()' call
    similar to one of these examples, in order to select the desired version:

    pkg_resources.require("functional") # latest installed version
    pkg_resources.require("functional==0.5") # this exact version
    pkg_resources.require("functional>=0.5") # this version or higher

    Processing dependencies for functional==0.5

    What's all this about multi-version? Did I do something wrong?
    I've tried installing the package in all sorts of ways and haven't
    been able to reproduce this problem. I'm guessing that somewhere in
    your setuptools configuration, however, that there's a config file
    passing --multi-version or --install-dir without your knowledge. Do
    you get this same message when installing other Python packages?

    Thanks,
    Collin Winter

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 10, '06 at 5:13p
activeFeb 12, '06 at 6:27a
posts6
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase