News for hackers. Stuff that matters.
Re:Refined: Simple Refinement Types for Rust by yencabulator on Thursday February 13, 2025 @01:19PM (#43039297)
I'm not convinced this is in practice better than a newtype with a hand-written `pub fn new(...)` that returns Option or Result. Sure, you get And/Or from the library, but the cognitive overhead is not free!

Also, the post talks about how one should prefer parsers over validators, but the library `refined` actually makes you to write validators not parsers: https://docs.rs/refined/latest/refined/trait.Predicate.html -- the library them combines validatators