A collection of utilities to help write python as though it were an ML-kind of functional language like OCaml
Project description
FunML
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:
- Immutable data structures like enums, records, lists
- Piping outputs of one function to another as inputs. That's how bigger functions are created from smaller ones.
- Pattern matching for declarative conditional control of flow instead of using 'if's
- Error handling using the
Result
monad, courtesy of rust. Instead of usingtry-except
all over the place, functions return aResult
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. - No
None
. Instead, we use theOption
monad, courtesy of rust. When an Option has data, it isOption.SOME
, or else it isOption.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.
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.