Skip to content

Implementation of Haskell's autocurry feature in Python using a decorator

License

Notifications You must be signed in to change notification settings

felixbr/autocurry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autocurry

Currying is a powerful technique in functional programming languages like Haskell. This decorator allows a function to be automatically curried by supplying fewer arguments than required.

Installation

pip3 install autocurry

Usage

from autocurry import autocurry

@autocurry
def find_by_key_with_connection(db_connection, key):
    ...
    
find_by_key = find_by_key_with_connection(some_connection)

value1 = find_by_key('my_key')
value2 = find_by_key('your_key')

About

Implementation of Haskell's autocurry feature in Python using a decorator

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published