OSlash
OSlash copied to clipboard
Functors, Applicatives, And Monads in Python
This will include the license file in the PyPI sdist. Context: I'm trying to get this package onto Conda Forge and they require the license file to be bundled in...
I've found these classes need repr's when debugging. Before: ```python >>> Left(1) ``` After: ```python >>> Left(1) Left(1) ```
OSlash is primarily meant to be a Monad tutorial for Python. If you want to use types like `Maybe` and `Either` in your Python code, you should also take a...
1. def orElse(either1, either2) (try one either, or else ty the next one) 2. validation data type ==> Left of Either lifted to a List 3. Applicative for validation to...
I can see the latest release being 0.5.1 which is on April 2015. I find this project super useful, and would like to get a newer release. Please let me...
An example is worth 1000 words: ```python import oslash def operation_that_succeeds(input): return oslash.Right(input + 1) def operation_that_fails(input): return oslash.Left("Failure") def lift(m): def w(f): return lambda x: m.unit(f(x)) return w @lift(oslash.Right)...
type checking the follow program with `mypy`: ```python from oslash import List IntList = List[int] def f() -> IntList: return List.unit(0) ``` Yields `error: Invalid type "StrList"`.
Hello, I am going through a book by Martin McBride about functional programming in Python. I know this is not production-class library, but I am trying to instantiate a List...
Replaced the use of old-style formatting strings in __str__ methods. At first, that seems like a dated but harmless practice, but unfortunately While dated and seemingly a harmless practice, OSlash...