Learn Type-Driven Development: Benefit from type systems to build reliable and safe applications using ReasonML 3
暫譯: 學習型別驅動開發:利用型別系統使用 ReasonML 3 構建可靠且安全的應用程式

Yawar Amin, Kamon Ayeva

  • 出版商: Packt Publishing
  • 出版日期: 2018-12-26
  • 售價: $1,200
  • 貴賓價: 9.5$1,140
  • 語言: 英文
  • 頁數: 180
  • 裝訂: Paperback
  • ISBN: 1788838017
  • ISBN-13: 9781788838016
  • 相關分類: JavaScript
  • 立即出貨 (庫存=1)

相關主題

商品描述

A fast paced guide for JavaScript developers for writing safe, fast, and reusable code by leveraging ResaonML's strong static type system

Key Features

  • Reduce code errors with the power of type systems
  • Employ static typechecking and genericity to promote code reuse and consistency
  • Understand functional programming which is the foundation of type-driven development

Book Description

Type-driven development is an approach that uses a static type system to achieve results including safety and efficiency. Types are used to express relationships and other assumptions directly in the code, and these assumptions are enforced by the compiler before the code is run. Learn Type-Driven Development covers how to use these type systems to check the logical consistency of your code.

This book begins with the basic idea behind type-driven development. You'll learn about values (or terms) and how they contrast with types. As you progress through the chapters, you'll cover how to combine types and values inside modules and build structured types out of simpler ones. You'll then understand how to express choices or alternatives directly in the type system using variants, polymorphic variants, and generalized algebraic data types. You'll also get to grips with sum types, build sophisticated data types from generics, and explore functions that express change in the types of values. In the concluding chapters, you'll cover advanced techniques for code reuse, such as parametric polymorphism and subtyping.

By end of this book, you will have learned how to iterate through a type-driven process of solving coding problems using static types, together with dynamic behavior, to obtain more safety and speed.

What you will learn

  • Use static types to capture information, making programs safer and faster
  • Learn ReasonML from experienced type-driven developers
  • Enhance safety by simply using basic types
  • Understand the most important type-driven concepts with simple examples
  • Explore a design space using static typing and find the best way to express your system rules
  • Use static types and dynamic runtime in harmony to write even safer and faster code

Who this book is for

If you're a programmer working with dynamically typed languages and are looking for ways to mitigate production runtime errors, Learn Type-Driven Development is for you. You'll also find this book helpful if you're a programmer working with statically typed languages looking for increased safety and improved performance.

Table of Contents

  1. Start Type-Driven Development
  2. Program with types and values
  3. Package types and values together
  4. Group values together in types
  5. Put alternative values in types
  6. Make types that can 'slot in' any other type
  7. " Make types that represent operations"
  8. "Reuse code with many different types"
  9. "Extend types with new behavior"
  10. "Bring it all together"

商品描述(中文翻譯)

**一本快速指南,幫助 JavaScript 開發者利用 ReasonML 的強靜態類型系統編寫安全、快速且可重用的代碼**

#### 主要特點
- 利用類型系統的力量減少代碼錯誤
- 使用靜態類型檢查和泛型促進代碼重用和一致性
- 理解函數式編程,這是類型驅動開發的基礎

#### 書籍描述
類型驅動開發是一種使用靜態類型系統來實現安全性和效率的方式。類型用於直接在代碼中表達關係和其他假設,這些假設在代碼運行之前由編譯器強制執行。《學習類型驅動開發》涵蓋了如何使用這些類型系統來檢查代碼的邏輯一致性。

本書從類型驅動開發的基本概念開始。您將學習值(或術語)以及它們與類型的對比。隨著章節的進展,您將學習如何在模塊內結合類型和值,並從更簡單的類型構建結構化類型。接著,您將理解如何使用變體、多態變體和廣義代數數據類型直接在類型系統中表達選擇或替代方案。您還將掌握和總和類型,從泛型構建複雜的數據類型,並探索表達值類型變化的函數。在結尾章節中,您將學習代碼重用的高級技術,例如參數多態性和子類型。

在本書結束時,您將學會如何通過靜態類型和動態行為迭代類型驅動的編碼問題解決過程,以獲得更高的安全性和速度。

#### 您將學到的內容
- 使用靜態類型捕捉信息,使程序更安全、更快速
- 向經驗豐富的類型驅動開發者學習 ReasonML
- 通過簡單使用基本類型來增強安全性
- 用簡單的例子理解最重要的類型驅動概念
- 使用靜態類型探索設計空間,找到表達系統規則的最佳方式
- 和諧地使用靜態類型和動態運行時來編寫更安全、更快速的代碼

#### 本書適合誰
如果您是一名使用動態類型語言的程序員,並且正在尋找減少生產運行時錯誤的方法,《學習類型驅動開發》適合您。如果您是一名使用靜態類型語言的程序員,並希望提高安全性和性能,您也會發現本書對您有幫助。

#### 目錄
1. 開始類型驅動開發
2. 使用類型和值編程
3. 將類型和值打包在一起
4. 在類型中將值分組
5. 在類型中放置替代值
6. 創建可以“插入”任何其他類型的類型
7. 創建表示操作的類型
8. 使用多種不同類型重用代碼
9. 用新行為擴展類型
10. 將所有內容整合在一起