monadless
async-trait
Our great sponsors
monadless | async-trait | |
---|---|---|
4 | 7 | |
275 | 1,691 | |
0.4% | - | |
0.0 | 8.2 | |
about 2 months ago | 9 days ago | |
Scala | Rust | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
monadless
- "A New Library For Imperative ZIO Programming" by Alexander Ioffe at Functional Scala 2022
-
Kind: A Modern Proof Language
Well `RecordWildcards` has been around for 14 years... but even without it instead of `{..}` you'd just have `_`s. The main thing that is different is that your Kind example had nested case statements while your Haskell example tried to match everything on one shot, which makes for a non-equivalent comparison.
> Not sure how that could work, though. Idris had an interesting syntax, but IIRC it wasn't general.
I assume you're talking about idiom brackets for applicatives? The general syntax is given in something like https://github.com/monadless/monadless. The idea is to basically take async-await syntax and generalize it to any monad.
So e.g. your `Maybe` example (using `!` for the equivalent of `await` for concision) would look like
Maybe {
-
Why asynchronous Rust doesn't work
> If anything, async-await feels like an extremely non-functional thing to begin with
It, like many other things, forms a monad. In fact async-await is a specialization of various monad syntactic sugars that try to eliminate long callback chains.
Hence things like Haskell's do-notation are direct precursors to async-await (some libraries such as Scala's monadless https://github.com/monadless/monadless make it even more explicit, there lift and unlift are exactly generalized versions of async and await).
async-trait
-
Introduction to Rust generics [1/2]: Traits
As of today, async functions in traits are not natively supported by Rust. Fortunately, David Tolnay got our back covered (one more time): we can use the async-trait crate.
- How to assign async fn to type?
-
Understanding lifetimes for real?
You might want to check out https://github.com/dtolnay/async-trait to be able to declare async functions in a trait.
-
David Tolnay - thank you
Also async-trait (GitHub), dtolnay has done some great work!
-
What are your favorite tricks or hacks in rust?
Does async-trait count as a trick or hack? It's not my hack, but it's a workaround/hack that I use every single day.
-
Why asynchronous Rust doesn't work
This macro goes a very long way toward solving the problem: https://github.com/dtolnay/async-trait
-
Question about traits, associated types, Future, Pin, and Send...
I'm still learning async to I cannot answer all the questions. First of all, I use this -> https://github.com/dtolnay/async-trait to take care of the async-inside-traits mess.
What are some alternatives?
py2many - Transpiler of Python to many other languages
ureq - A simple, safe HTTP client
blog-comments - Comments for the blog at theta.eu.org.
reqwest - An easy and powerful Rust HTTP Client
serde-yaml - Strongly typed YAML library for Rust
Formality - A modern proof language [Moved to: https://github.com/kind-lang/Kind]
rust-quiz - Medium to hard Rust questions with explanations
rupy - HTTP App. Server and JSON DB - Shared Parallel (Atomic) & Distributed
toml-rs - A TOML encoding/decoding library for Rust
cargo-llvm-lines - Count lines of LLVM IR per generic function