Skip to content

aymanizz/exotic-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Exotic Function

A module for writing in a functional and/or declarative style, but in an exotic way!

You can curry, compose, and do other stuff with the help of the exotic functions.

Quick Example

Here is an example:

>>> exotic % print * 'output: ' | unpack << exotic % map * int @ str.split @ input * 'numbers: ' | apply
numbers: 1 2 3 4
output:  1 2 3 4

which is equivalent to:

>>> print('output: ', *(list(map(int, str.split(input('numbers: '))))))

or in a more readable way:

inp = input('numbers: ').split()
inp = map(int, inp)
print('output: ', *inp)

more examples can be found in the module source file, builder.py.

Testing

To test the module run:

$ python3 -m doctest -v builder.py

About

A python module for currying, partially applying, and composing functions in an exotic way.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages