Re:Criticizing Hare language approach for generic data struc...
by jolux on Wednesday May 04, 2022 @09:24AM
(#31260032)
Functional programming patterns are very common in Rust code. It doesn’t have automatic currying or higher-kinded types but it has generic associated types, anonymous functions, closures, and a rich set of collections with functional processing methods in the standard library.
[ Parent
| on HN ]
Re:Criticizing Hare language approach for generic data struc...
by capableweb on Wednesday May 04, 2022 @09:30AM
(#31260101)
A lot of the standard library and an extensive part of the community ecosystem lives and breathes mutation at both the edges and in the internals, something people normally would avoid when trying to stick with functional programming. Sure, some mutation is always needed, but Rust wouldn't be the first language I'd pick if I want to focus on functional programming for sure.
Re:Criticizing Hare language approach for generic data struc...
by jolux on Wednesday May 04, 2022 @09:48AM
(#31260357)
No, but it’s widely acknowledged that functional programming features are useful even in imperative languages. Almost every imperative language that isn’t C, Go, or Hare has them. Java, C#, JavaScript, Python, Ruby. You should take a look at all the functions available on iterators in Rust if you haven’t. The Rust community tends to prefer using iterators to express things like looping when possible, which is a more functional style.
Re:Criticizing Hare language approach for generic data struc...
by zozbot234 on Wednesday May 04, 2022 @09:39AM
(#31260204)
Mutation within a single program flow is a well-known functional programming pattern, e.g. as supported by the ST feature in Haskell. Shared mutability is much harder to reason about, so is generally excluded and Rust implements it separately.