fulcrumgenomics / fgpyo

Quality of life improvements for Bioinformatics in Python.
https://fgpyo.readthedocs.io/en/latest/
Other
27 stars 3 forks source link

Create an equivalent to scala's `Either` class #42

Open tfenne opened 1 year ago

tfenne commented 1 year ago

Would be nice to include functions that take lambdas too in order to make it easier to do map/foreach type operations if left or right is populated.

geoffjentry commented 1 year ago

I would have think there's at least one python library out there providing a set of Practical For The Real World monadic types

geoffjentry commented 1 year ago

If you hadn't already looked down this route, quick google search turned up a few things that all looked like they had an Either (or equivalent):

tfenne commented 1 year ago

So the questions are:

  1. Are any of them any good?
  2. Are they actively maintained?
  3. Do they have good docs, types on things, etc. that make them easy to use
  4. Do they come with a lot of cruft we might not want (especially more dependencies)

PyMonad: hasn't been touched in 2+years, logged issues are not responded to, isn't on ReadThDocs. Is on pip but not conda.

typed-monads: has a Result type but no Either. No commits in a year. Not on ReadTheDocs...

OSlash: hasn't been touched in years. One of the top issues is "is this usable in real projects" and the author answers "yeah, not really, this is more of a tutorial", lol.