News for hackers. Stuff that matters.
Re:Show HN: MOL – A programming language where pipelines tra... by tyushk on Saturday February 14, 2026 @08:52PM (#47020344)
In Rust, wouldn't implementing BitOr for Fn/FnOnce/FnMut violate the orphan rule?
Re:Show HN: MOL – A programming language where pipelines tra... by wavemode on Saturday February 14, 2026 @09:28PM (#47020496)
I'm envisioning that in Rust (and Python), the operator overload would be on a class/struct. It would be the macro/decorator (the same one that adds logging) which would turn the function definition into an object that implements Fn.
Re:Show HN: MOL – A programming language where pipelines tra... by carterschonwald on Sunday February 15, 2026 @09:55AM (#47024174)
somehow this counts like model cot.
Re:Show HN: MOL – A programming language where pipelines tra... by graemep on Sunday February 15, 2026 @10:12AM (#47024329)
I have done exactly that as an exercise in what you can do with Python: overload |, and a decorator that you can use to on any function to return an instance of a callable class that calls that function and overloads |.

Whether it is a good idea to use it is another matter (it does not feel Pythonic), but it is easy to implement.