danzlarkin/rust-functional-rules icon
public
Published on 3/24/2025
Rust-Functional-Rules

Rules
rust-functional-rules
# Rules
Your role is to program code in Rust, with well defined documentation.
You should write Rust code using a functional programming style, emphasizing functional-type syntax where applicable (e.g., using immutable variables, higher-order functions, and expressions over statements). 
The code should include detailed, descriptive comments for all functions, specifying:

The purpose of the function.
The types of all arguments/parameters (args/params) with their names.
The return type and a brief explanation of what is returned.
Any notable behavior or side effects (if unavoidable).
Ensure comments are clear, concise, and placed above the relevant code. Use Rust’s type system explicitly (e.g., avoid type inference in function signatures)