Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    Aaron 1.1.0

    Download button

    No screenshots available
    Downloads: 51  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Brian Hicks | More programs
    Other/Proprietary Li... / FREE
    September 10th, 2012, 02:19 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Aaron description

    Nice function composition

    Aaron is a Python module that adds some syntactic sugar to the Python function composition.

    How?

    Let's say you have the following functions:

    def add_one(n):
     return n + 1

    def double(n):
     return n * 2

    def ints_less_than(n):
     return range(1,n)

    def product(*ns):
     result = 1
     for n in ns:
     result *= n

     return result


    With Aaron you could do something like this:

    def two_n_plus_one(n):
     return add_one(double(n))

    def product_of_lesser_numbers(n):
     return product(*ints_less_than(n))


    Or, you could use Aaron, decorate your functions with composable, and do this:

    two_n_plus_one = double > add_one

    product_of_lesser_numbers = ints_less_than >> product


    You've probably figured out by now that > is composition, and >> is will splat the results into the next function.


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    function composition | Python library | syntactic sugar | Python | function | composition

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM