Skip to main content

A collection of utilities to help write python as though it were an ML-kind of functional language like OCaml

Project description

FunML

PyPI version CI

A collection of utilities to help write python as though it were an ML-kind of functional language like OCaml

The API is still unstable. Use at your own risk.


Documentation: https://sopherapps.github.io/funml

Source Code: https://github.com/sopherapps/funml


Most Notable Features are:

  1. Immutable data structures like enums, records, lists
  2. Piping outputs of one function to another as inputs. That's how bigger functions are created from smaller ones.
  3. Pattern matching for declarative conditional control of flow instead of using 'if's
  4. Error handling using the Result monad, courtesy of rust. Instead of using try-except all over the place, functions return a Result which has the right data when successful and an exception if unsuccessful. The result is then pattern-matched to retrieve the data or react to the exception.
  5. No None. Instead, we use the Option monad, courtesy of rust. When an Option has data, it is Option.SOME, or else it is Option.NONE. Pattern matching helps handle both scenarios.

Dependencies

Contributing

Contributions are welcome. The docs have to maintained, the code has to be made cleaner, more idiomatic and faster, and there might be need for someone else to take over this repo in case I move on to other things. It happens!

Please look at the CONTRIBUTIONS GUIDELINES

Benchmarks

TBD

License

Licensed under both the MIT License

Copyright (c) 2023 Martin Ahindura

Gratitude

"...and His (the Father's) incomparably great power for us who believe. That power is the same as the mighty strength He exerted when He raised Christ from the dead and seated Him at His right hand in the heavenly realms, far above all rule and authority, power and dominion, and every name that is invoked, not only in the present age but also in the one to come."

-- Ephesians 1: 19-21

All glory be to God.

Buy Me A Coffee

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

funml-0.0.1.tar.gz (15.4 kB view hashes)

Uploaded Source

Built Distribution

funml-0.0.1-py3-none-any.whl (18.0 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