Skip to main content

Forbidden Functional Programming in Python.

Project description

forbiddenfp

Summary

Functional-Programming (FP) in a forbidden way.

Definitely Not Safe For Work.

pip install forbiddenfp

This library patches builtin object (and hence ALL classes),

with the ability to turn arbitrary function into postfix notation as function chaining.

The library already provides some patch for builtin/itertools functions.

Something like:

# objects are already patched at import time
import forbiddenfp

"abc".then(lambda s: s * 2)  # "abcabc"
"abc".apply(print).len()  # print out "abc", then return 3

See more ./examples.

Known Issues

None doesn't work well with chained keyword arguments.

import forbiddenfp

None.apply(print)  # works
None.apply(func=print)  # doesn't work

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forbiddenfp-0.5.1.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

forbiddenfp-0.5.1-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page