Principles, Best Practices and Design Patterns for functional programming

后端 未结 7 1502
我在风中等你
我在风中等你 2021-01-31 09:56

Are there any known principles, best-practices and design patterns that one can follow while writing code in a functional programming language?

7条回答
  •  失恋的感觉
    2021-01-31 10:29

    Best practice: use algebraic data types and take advantage of exhaustiveness checking from the pattern-match compiler. In particular,

    • Never match a wildcard pattern _ at top level.

    • Set compiler options so that a missing case in a pattern match is an error, not a warning.

提交回复
热议问题