fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

10K
active users

It's so frustrating that whenever I ask about Functional Programming-style crates in Rust, the answer I get is mostly discouragement about doing full FP in rust.

Isn't rust supposed to have FP support?

Isn't FP supposed to help your programs be simpler, regardless of how purely functional your language is?

@Amirography interesting. Can you elaborate a bit about what you consider "full FP" in this case ?

It might help explain both the responses/answers and shed light on why you find it frustrating :)

@lloydmeta by that I mean pure. And let me emphasize that I'm not asking for pure. But the mention of an FP style (or the best I can get) only gets warning about pure FP. Which was not what I was asking for.

@Amirography Gotcha…and what exactly is meant by “pure FP” in this sense? I kinda have an idea, but want to make sure I’m on the same page here, since often the definition differs based on context, as well as who is reading and writing those words..

@lloydmeta Side effects-less functions up until "main" and no use of mutability.

@Amirography. It’s what I thought, given FP zeitgeist and what Rust can enable :D

While I don’t necessarily agree that you should be discouraged from “pure FP” when you ask for “FP”, I can see why ppl would warn/discourage the former, given that safe/tracked mutation is literally part of the language. You *can* wrap it but you end up paying in terms of complexity/perf.

Embracing `mut` does require some relearning for FP diehards, so maybe they wanted to be up front about it.

PRMA

@lloydmeta i can see that. Though there is enough time that happened that I'm disappointed with my efforts to learn FP patterns from Rust community. I'm taking a stab at Haskell to learn the over-arching patterns.

Although I found the 'nom' crate to be one yummy cookie, it is a lower level library, and does not provide examples of how an application may push IO side effects to the edge.

@Amirography I think that’s a great call! Haskell is a great place for learning/stealing FP patterns that can then be applied in other places :)