Skip to content

kaiserthe13th/curriedef

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Curriedef

Currying facade for Python.

This package provides the curried class and the curry decorator to create curried functions.

Installation

pip install curriedef

Examples

from curriedef import curried

def add(a, b):
    return a + b

add_two = curried(add)(2)

print(add_two(1)) # prints "3"
print(add_two(2)) # prints "4"
print(add_two(10)) # prints "12"

That's great but having to type curried every single time you want to curry a function is a pain, isn't it?. Because of that there is a curry decorator.

from curriedef import curry

@curry
def add(a, b):
    return a + b

add_two = add(2)

print(add_two(1)) # prints "3"
print(add_two(2)) # prints "4"
print(add_two(10)) # prints "12"

About

Currying facade for Python.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages