Learning Functional Programming in Go: Change the way you approach your applications using functional programming in Go

Lex Sheehan

  • 出版商: Packt Publishing
  • 出版日期: 2017-11-24
  • 售價: $1,860
  • 貴賓價: 9.5$1,767
  • 語言: 英文
  • 頁數: 672
  • 裝訂: Paperback
  • ISBN: 1787281396
  • ISBN-13: 9781787281394
  • 相關分類: Go 程式語言
  • 下單後立即進貨 (約3~4週)

商品描述

Key Features

  • Write concise and maintainable code with streams and high-order functions
  • Understand the benefits of currying your Golang functions
  • Learn the most effective design patterns for functional programming and learn when to apply each of them
  • Build distributed MapReduce solutions using Go

Book Description

Functional programming is a popular programming paradigm that is used to simplify many tasks and will help you write flexible and succinct code. It allows you to decompose your programs into smaller, highly reusable components, without applying conceptual restraints on how the software should be modularized.

This book bridges the language gap for Golang developers by showing you how to create and consume functional constructs in Golang.

The book is divided into four modules. The first module explains the functional style of programming; pure functional programming (FP), manipulating collections, and using high-order functions. In the second module, you will learn design patterns that you can use to build FP-style applications. In the next module, you will learn FP techniques that you can use to improve your API signatures, to increase performance, and to build better Cloud-native applications. The last module delves into the underpinnings of FP with an introduction to category theory for software developers to give you a real understanding of what pure functional programming is all about, along with applicable code examples.

By the end of the book, you will be adept at building applications the functional way.

What you will learn

  • Learn how to compose reliable applications using high-order functions
  • Explore techniques to eliminate side-effects using FP techniques such as currying
  • Use first-class functions to implement pure functions
  • Understand how to implement a lambda expression in Go
  • Compose a working application using the decorator pattern
  • Create faster programs using lazy evaluation
  • Use Go concurrency constructs to compose a functionality pipeline
  • Understand category theory and what it has to do with FP

About the Author

Lex Sheehan has a B.S. in Computer Science from Auburn University, resides in Atlanta, GA, and works as a senior software engineer with over 20 years of experience. He has a deep understanding of functional programming; His first encounter was using high-order functions in Ruby, Scala, JavaScript, Haskell, Java, and Go.

Lex worked for IBM Software Group and IBM Global Business Services, designing and building various enterprise business systems. He is the author of eight US patents (IT security and data transformations) and he writes a blog titled Application Development with Lex Sheehan.

Lex is available to consult and meet with your CTO, or provide in-house training on the information in this book.

Table of Contents

  1. Pure Functional Programming in Go
  2. Manipulating Collections
  3. Using Higher Order Functions
  4. SOLID Design in Go
  5. Adding Functionality with Decoration
  6. Building on an Onion Architecture
  7. Functional Parameters
  8. Increasing Performance Using Pipelining
  9. Intro to Category Theory for Software Developers
  10. Functors, Monoids, and Type Classes
  11. Monads
  12. Appendix

商品描述(中文翻譯)

主要特點


  • 使用串流和高階函式撰寫簡潔且易於維護的程式碼

  • 了解將 Golang 函式轉換為柯里化函式的好處

  • 學習最有效的函數式程式設計設計模式,並了解何時應用每一種模式

  • 使用 Golang 建立分散式 MapReduce 解決方案

書籍描述

函數式程式設計是一種流行的程式設計範式,用於簡化許多任務,並幫助您撰寫靈活且簡潔的程式碼。它允許您將程式分解為更小、高度可重複使用的元件,而不會對軟體的模組化方式施加概念上的限制。

本書通過向您展示如何在 Golang 中創建和使用函數式構造來彌合 Golang 開發者之間的語言差距。

本書分為四個模組。第一個模組解釋了函數式程式設計的風格;純函數式程式設計(FP)、操作集合和使用高階函式。在第二個模組中,您將學習可以用於構建 FP 風格應用程式的設計模式。在下一個模組中,您將學習可以用於改進 API 簽名、提高性能和構建更好的雲原生應用程式的 FP 技術。最後一個模組深入探討了函數式程式設計的基礎,介紹了類別理論,以便軟體開發人員真正了解純函數式程式設計的內涵,並提供適用的程式碼範例。

通過閱讀本書,您將能夠以函數式的方式構建應用程式。

您將學到什麼


  • 學習如何使用高階函式組合可靠的應用程式

  • 探索使用函數式程式設計技術(如柯里化)消除副作用的技巧

  • 使用一級函式實現純函數

  • 了解如何在 Go 中實現 lambda 表達式

  • 使用裝飾器模式構建工作應用程式

  • 使用延遲評估創建更快的程式

  • 使用 Go 並行構造組合功能管道

  • 了解類別理論及其與函數式程式設計的關聯

關於作者

Lex Sheehan 擁有奧本大學(Auburn University)的計算機科學學士學位,居住在喬治亞州亞特蘭大市,擁有超過 20 年的資深軟體工程師經驗。他對函數式程式設計有深入的了解;他首次接觸高階函式是在 Ruby、Scala、JavaScript、Haskell、Java 和 Go 中。

Lex 曾在 IBM 軟體集團和 IBM 全球商務服務部門工作,設計和構建各種企業業務系統。他是八項美國專利(IT 安全和資料轉換)的作者,並撰寫了一個名為「Application Development with Lex Sheehan」的部落格。

Lex 可提供諮詢和與您的 CTO 會面,或就本書中的資訊提供內部培訓。

目錄


  1. Go 中的純函數式程式設計

  2. 操作集合

  3. 使用高階函式

  4. Go 中的 SOLID 設計

  5. 使用裝飾器增加功能

  6. 建立洋蔥架構

  7. 函數式參數

  8. 使用管線增加效能

  9. 軟體開發人員的類別理論入門

  10. 函子、單子和型別類別

  11. Monad

  12. 附錄