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

Additional Functional Programming Techniques

  • Michael Bruno Lochemem

摘要

This chapter is a miscellaneous one. Its contents are expositions of concepts that complement composition, ideas that have purchase in Functional Programming, but do not perfectly fit any of the preceding chapters. Lenses, recursion, pattern matching, and property testing are wonderful concepts that are not necessarily directly related to each other, but can be used conjunctively nonetheless. Lenses make it possible to precisely modify composite data like that in a list with neat getters and setters; recursion provides an alternative and, depending on the algorithmic demands of a solution, a nice complement to run-of-the-mill iteration; pattern matching makes for great flow control, especially in situations where the contextual data has a richness about it, situations where there is significant entropy; property testing is a means of rigorously evaluating program correctness. Please proceed to avail yourself of the concepts discussed in this penultimate chapter.