Lispy (and some haskelly) missing batteries for Python.
Project description
Python clearly wants to be an impure-FP language. A decorator with arguments is a curried closure - how much more FP can you get?
We provide some missing features for Python from the list processing tradition, plus a few bonus haskellisms.
We place a special emphasis on clear, pythonic syntax, as far as possible without MacroPy. Other design considerations are simplicity, robustness, and minimal dependencies (currently none).
Tail call optimization (TCO), TCO’d loops in FP style, call/ec, let & letrec, assign-once, multi-expression lambdas, def as a code block, dynamic assignment, memoize (also for generators and iterables), compose, folds and scans (left and right), unfold, lazy partial unpacking of iterables, functional sequence updates, pythonic lispy linked lists.
We also provide a curry that passes extra arguments through on the right, and calls a callable return value on the remaining arguments. This is now valid Python:
mymap = lambda f: curry(foldr, composerc(cons, f), nil) myadd = lambda a, b: a + b assert curry(mymap, myadd, ll(1, 2, 3), ll(2, 4, 6)) == ll(3, 6, 9)
For documentation and examples, see the project’s GitHub homepage.
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
Built Distribution
File details
Details for the file unpythonic-0.9.0.tar.gz
.
File metadata
- Download URL: unpythonic-0.9.0.tar.gz
- Upload date:
- Size: 110.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.4.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c4baf94b01427d62a18d64c6a70e5505e0cf77dcf6b7f1a61f93fb1838c3158 |
|
MD5 | 20ef006f464a618888cae4ac887a0107 |
|
BLAKE2b-256 | 76abf5331e1ad20ba127588a60354889cc9dfe7f761d30ba74d129f6c0cef0b3 |
File details
Details for the file unpythonic-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: unpythonic-0.9.0-py3-none-any.whl
- Upload date:
- Size: 125.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.4.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e3e7765ce355923e6c17ea5f2e54c8ea2bc4433ae770e02c0ac4498a164df29 |
|
MD5 | e85f309ed590c98935aeef3ebc22b8c5 |
|
BLAKE2b-256 | 2c574f90e25bf03a866c8f7a195f65267d383c96274b889c1db4b9bb205e73d1 |