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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for forbiddenfp-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d9b472f6e46234766c4ed73c39c3715fcfb5cf1fac22c83a7cf8711fbef8e15 |
|
MD5 | d049b02ed39aef51ffa6109236a6f178 |
|
BLAKE2b-256 | d94512ee17263676d7f96c926c0b8ad32589958604844cc93eabddbef7feb762 |