You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-12 01:00:16 +02:00
Rephrase functional comment
This commit is contained in:
@ -27,11 +27,16 @@ Additional items speaker may mention:
|
|||||||
types. ["Domain Modeling Made Functional"][1] is a great resource on the
|
types. ["Domain Modeling Made Functional"][1] is a great resource on the
|
||||||
topic, with examples written in F#.
|
topic, with examples written in F#.
|
||||||
|
|
||||||
- Despite Rust's functional roots, functional design patterns don't translate
|
- Despite Rust's functional roots, not all functional design patterns can be
|
||||||
as-is to Rust. For instance, extensive use of higher-order functions and
|
easily translated to Rust.
|
||||||
higher-kinded types can result in code that is harder to read and maintain.
|
|
||||||
Design patterns in Rust must take into account (and leverage!) the granular
|
For example, you must have a solid grasp on a broad selection of advanced
|
||||||
control over mutability that comes with its borrow checker.
|
topics to design APIs that leverage higher-order functions and higher-kinded
|
||||||
|
types in Rust.
|
||||||
|
|
||||||
|
Evaluate, on a case-by-case basis, whether a more imperative approach may be
|
||||||
|
easier to implement, relying on Rust's borrow-checker and type system to
|
||||||
|
control what can be mutated, and where.
|
||||||
|
|
||||||
- The same caution should be applied to object-oriented design patterns. Rust
|
- The same caution should be applied to object-oriented design patterns. Rust
|
||||||
doesn't support inheritance, and object decomposition should take into account
|
doesn't support inheritance, and object decomposition should take into account
|
||||||
|
Reference in New Issue
Block a user