Skip to content

Commit 71204b7

Browse files
Rephrase functional comment
1 parent 06865d4 commit 71204b7

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/idiomatic/leveraging-the-type-system.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ Additional items speaker may mention:
2727
types. ["Domain Modeling Made Functional"][1] is a great resource on the
2828
topic, with examples written in F#.
2929

30-
- Despite Rust's functional roots, functional design patterns don't translate
31-
as-is to Rust. For instance, extensive use of higher-order functions and
32-
higher-kinded types can result in code that is harder to read and maintain.
33-
Design patterns in Rust must take into account (and leverage!) the granular
34-
control over mutability that comes with its borrow checker.
30+
- Despite Rust's functional roots, not all functional design patterns can be
31+
easily translated to Rust.
32+
33+
For example, you must have a solid grasp on a broad selection of advanced
34+
topics to design APIs that leverage higher-order functions and higher-kinded
35+
types in Rust.
36+
37+
Evaluate, on a case-by-case basis, whether a more imperative approach may be
38+
easier to implement, relying on Rust's borrow-checker and type system to
39+
control what can be mutated, and where.
3540

3641
- The same caution should be applied to object-oriented design patterns. Rust
3742
doesn't support inheritance, and object decomposition should take into account

0 commit comments

Comments
 (0)