Skip to main content

A set of tools for conveniently using monads

Project description

# Simplads #

Simplads are a way to structure complicated algorithms. Design and test each function independently and provide a single linking function to explain exactly what the code does. Elegantly introduce stateful operations only when needed without sacrificing readability or testability.

### Example usage ###

```python
from simplads import Bundle, WriterDeltaMaker, ReaderDeltamaker, lift
write = WriterDeltaMaker.write
read = ReaderDeltaMaker.read

# read and write example
def example():
obj = {}
b = Bundle().add_writer(obj).add_reader(obj)
return b.unit().pipe([
write,
read,
lift(lambda i: i.read_val)])

def read(i):
return Bundle.delta(i, 'writer', write(keys=['keys'], new_data='val'))

def write(i):
return Bundle.delta(i, 'reader', read(['key']))
```

### Installation ###

pip install simplads

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

simplads-0.33.tar.gz (7.5 kB view hashes)

Uploaded Source

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