- Functional Kotlin
- Mario Arias Rivu Chakraborty
- 112字
- 2021-06-24 19:15:26
Pure functions
Pure functions don't have side effects, nor memory, nor I/O. Pure functions have many properties, including referential transparency, caching (memoization), and others (we'll cover these features in the next chapters).
It is possible to write pure functions in Kotlin, but the compiler doesn't enforce it as in other languages. It is up to you to create pure functions to enjoy its benefits. Because Kotlin doesn't enforce pure functions, many programmers said that Kotlin isn't a real functional programming tool, and maybe they are right. Yes, Kotlin doesn't enforce pure functional programming, and that gives you great flexibility including the ability to write in a purely functional style, if you wish.
推薦閱讀
- DB2 V9權威指南
- Developing Middleware in Java EE 8
- Go并發編程實戰
- Elasticsearch Server(Third Edition)
- Python算法從菜鳥到達人
- Learning DHTMLX Suite UI
- PHP從入門到精通(第4版)(軟件開發視頻大講堂)
- Access 2010中文版項目教程
- Spring技術內幕:深入解析Spring架構與設計原理(第2版)
- 汽車人機交互界面整合設計
- Visual Studio Code 權威指南
- Python商務數據分析(微課版)
- 3D Printing Designs:Octopus Pencil Holder
- 一步一步學Spring Boot:微服務項目實戰(第2版)
- JavaScript Mobile Application Development