错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Composition

  • Michael Bruno Lochemem

摘要

Composition is a common practice employed in everyday programming. Whenever an expression is written in such a way that the output of one function is used as the input of the one that succeeds it, a chain is formed. Chains that modify and propagate data through successive function calls are synonymous with composition. This chapter builds on the basics established in the previous one. For composition to work as it should, the functions that can be slotted into chains must pass all purity and referential transparency checks. It delves into the mechanics of composition and the patterns that spring from it, as well as those that can be enhanced by it.