Skip to main content

Contains composition of useful structures

Project description

Compositions

A package to introduce composable structures to python

Installation

pip install Compositions

Github Repository

Usage

from compositions.compositions import Compose

# Declare a composable function
@Compose
def f(x):
  return x

# Declare a composable function
@Compose
def g(x):
  return x**2 + x**3

print(g(3))
print(f(4))

# f(g(x))
print( (g*f)(3) )

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

Compositions-1.0.2.1.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

Compositions-1.0.2.1-py3-none-any.whl (3.2 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