TeaEntityLab/fpRust
Monad/MonadIO, Handler, Coroutine/doNotation, Functional Programming features for Rust
🦀 fpRust: Mang phong cách lập trình hàm và reactive vào Rust
Thư viện cung cấp Monad, MonadIO, Publisher, Coroutine, Actor và DoNotation cho Rust, lấy cảm hứng từ Haskell, Rx và lập trình bất đồng bộ.
fpRust là một thư viện Rust mở nguồn, xây dựng để mang các khái niệm lập trình hàm sâu như Monad, MonadIO, Coroutine, Actor và DoNotation vào ngôn ngữ Rust — nơi mà những tính năng này thường khó triển khai. Dự án lấy cảm hứng từ lập trình hàm (Haskell), lập trình reactive (Rx) và các mô hình bất đồng bộ phổ biến trong Java/Android.
✨ Điểm nổi bật
- MonadIO: Hỗ trợ
map,fmap,subscribe, đồng bộ và bất đồng bộ, tích hợpFuturequafeature: for_futures. - Publisher: Mô hình PubSub với hỗ trợ
Streamthông quasubscribe_as_stream()vàfeature: for_futures. - Hàm FP: Cung cấp macro
compose!,pipe!,map!,reduce!,filter!,foldl!,foldr!,contains!,reverse!. - Bất đồng bộ: Bao gồm
BlockingQueue,HandlerThread(lấy cảm hứng từ Android Handler),WillAsyncvàCountDownLatch. - Coroutine (Cor): Hỗ trợ generator giống Python,
yield/yieldFrom, đồng bộ và bất đồng bộ. - Actor: Mô hình Actor đơn giản với
receive/send/spawn, hỗ trợ trạng thái nội bộ và giao tiếp giữa các Actor. - DoNotation: Macro kiểu Haskell DoNotation dựa trên
Coroutine.
💡 Vì sao đáng chú ý
fpRust khá khác biệt so với các thư viện Rust khác ở chỗ tích hợp đồng thời nhiều khái niệm lập trình hàm phức tạp trong một crate duy nhất — từ Monad đến Actor và Coroutine. Điều này giúp người dùng dễ dàng áp dụng các mô hình reactive và bất đồng bộ mà không cần phụ thuộc vào nhiều thư viện rời nhau. Thích hợp cho dự án cần xử lý luồng dữ liệu phức tạp, xây dựng pipeline bất đồng bộ hoặc triển khai kiến trúc Actor trong Rust.
#Rust #FunctionalProgramming #ReactiveProgramming #Monad #Coroutine #ActorModel #TiniX
Dự án tương tự
Khám phá các dự án và mô hình AI khác có sự tương đồng.
Ivy Wallet is an open-source money manager app for Android, no longer maintained. You can fork the code or download the final version from Google Play.
all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...
A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io
A composable, cross-platform MVVM framework for .NET inspired by functional reactive programming. It moves mutable state out of the user interface, keeps each feature's logic in one readable place, and makes applications easier to test. Supports WPF, WinForms, WinUI, .NET MAUI, Avalonia, Uno Platform, Blazor and Android.
The perfect companion for your Kotlin journey - Inspired by functional, data-oriented and concurrent programming