keithasaurus / koda Goto Github PK
View Code? Open in Web Editor NEWType-safe functional tools for Python.
License: MIT License
Type-safe functional tools for Python.
License: MIT License
I love this project!
Just noticed that the library had a few changes that broke my tests:
OK(val=...)
<koda.result.Ok object at 0x0000017B109DBB80>
Ok(...)
I guess the latest is the best :-)
Hello there, thank you for the work you've done on this project!
I was curious if there was a supported or preferred way to encode the unit type ()
within koda
which is commonly found in many functional programming languages? I realize that ()
works syntactically in Python but it represents the empty tuple rather than unit. Alternatively, I suppose use of None
could also be used instead of Unit
but the issue is this won't work with common type checking tools like mypy
/pyre
/pyright
etc. I looked around the source code to see if there was something similar to how nothing
is defined but for unit
but couldn't find anything.
It would be great to be able to write something like:
def example(...) -> Result[Unit, str]:
if ...:
return Ok(())
else:
return Err("something went wrong")
Do you have any advice on how to do this? If this is something you'd be interested in adding I would be happy to contribute. Thank you in advance for any insights!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.