3 ms·
My impression has always been that it probably feels right at home for people with mathematical backgrounds, and mildly line-noisy for people coming from tradit
by jandrese 9y ago
My impression has always been that it probably feels right at home for people with mathematical backgrounds, and mildly line-noisy for people coming from traditional programming backgrounds.
Stuff like this:
fn map<T, U, F>(vector: &[T], function: F) -> Vec<U>
where F: for<'a> Fn(&'a T) -> U {
...
It's not too hard to read once you're in the ecosystem, but there's a lot of non-alphanumerics in there, and you know each one of them is super important to getting the thing working.
- carlmr 9y agoWhile I like the functional style you actually did bring up one of the cases where I find the syntax a bit too much. Why can't we have the functional interface information on F directly in the signature? Why not something more akin to ML? fn map<T, U, 'a>(vector: &[T], function: &'a T -> U) -> Vec<U>