No project description provided
Project description
# Gakp-pyfunk
A set of functional tools for python. It is supposed to have the same interface as Gakp-jsfunk and Gakp-lispfunk
## Example
```python
from pyfunk.combinators import compose
from pyfunk.collections import fmap
from pyfunk.functors.io import IO
def get_file(filename):
"""@sig get_file :: String -> IO String """
def open_file():
with open(filename) as f:
return f.read()
return IO(open_file)
def get_tokens(str):
return str.split()
def get_lenght_of_tokens(tokens):
return len(tokens)
tokenLength = compose(fmap(get_lenght_of_tokens), fmap(get_tokens), get_file)
print(tokenLength('.gitignore').unsafeIO())
```
## Contributing
Anyone can contribute using the fork and pull model.
A set of functional tools for python. It is supposed to have the same interface as Gakp-jsfunk and Gakp-lispfunk
## Example
```python
from pyfunk.combinators import compose
from pyfunk.collections import fmap
from pyfunk.functors.io import IO
def get_file(filename):
"""@sig get_file :: String -> IO String """
def open_file():
with open(filename) as f:
return f.read()
return IO(open_file)
def get_tokens(str):
return str.split()
def get_lenght_of_tokens(tokens):
return len(tokens)
tokenLength = compose(fmap(get_lenght_of_tokens), fmap(get_tokens), get_file)
print(tokenLength('.gitignore').unsafeIO())
```
## Contributing
Anyone can contribute using the fork and pull model.
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
pyfunk-1.0.0.tar.gz
(21.8 kB
view hashes)
Built Distribution
pyfunk-1.0.0-py2.py3-none-any.whl
(28.9 kB
view hashes)
Close
Hashes for pyfunk-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9cd624280a4ceb5093050fc0070a329f9e5d80808dffd24f61fe089abde86e0 |
|
MD5 | 1c64a6793db978e922a47d810a906e76 |
|
BLAKE2b-256 | e57b1d995fb9a539930e74f0731e2bba5deecf5fd0a68ce0f904046d2222f2da |