Hacker News new | ask | show | jobs
by kroltan 2218 days ago
It's horrible, I love it!

Interesting implementation of `If`, I had no idea the trait system could be... used... to such extent.

1 comments

A lot of this is fairly standard church encoding.
Not sure why this got downvoted. I'm familiar with Church encoding but not Rust's type system. Armed with that knowledge, I can read the source and deduce what the foreign syntax means. To somebody who knows neither, identifying this pattern can be helpful -- without that, they can read Rust docs and puzzle through the weird construction. With the information, they can read up on Church encoding at an abstract level, and then recognize it in the source -- which can help untangle the Rust syntax.