Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Port of Sodium - Functional Reactive Programming (FRP) library - to Python.
Just pip install sodiumfrp
.
This library is based on two types:
Stream
and Cell
.
Stream
represents a stream of events, while Cell
represents a value that changes over time.
There is also a bunch of primitives that you can use to build streams/cells and to compose them together.
They provide means for doing common operations like mapping, filtering, reduction, flat-mapping and more.
All of them are implemented as members of
Stream
and Cell
classes.
In situations, where a stream or cell needs to be referenced before it is assigned, use
StreamLoop
or
CellLoop
.
Stream
and Cell
lets you model your business logic in a purely functional way.
In order to provide your model with input data, use
StreamSink
and
CellSink
.
And, whenever you need to get data out of the model, use
Stream.listen()
and Cell.listen()
.
When an input value is pushed into a stream or cell, Sodium automatically starts a transaction.
Any state changes, that occur as a result of that input, are performed within the same transaction.
Most of the time you don't need to do anything, but it is possible to start a transaction explicitly via
Transaction.run()
.
For example:
StreamLoop
and CellLoop
require an explicit transaction.The most comprehensive guide on FRP and this library would be the book Functional Reactive Programming by Stephen Blackheath. Even though, the book aims Java, it is pretty straightforward to map it into Python.
See examples directory.
To run the tests, execute pytest
from the package directory.
To build API reference, go to docs
directory and run make html
.
It requires sphinx
and sphinx-rtd-theme
packages to be installed.
Distributed under BSD 3-Clause.
FAQs
Python implementation of Sodium - Functional Reactive Programming (FRP) library
We found that sodiumfrp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.