Stylish F♯ : crafting elegant functional code for .NET and .NET core /
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
[California] :
Apress,
[2018]
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Intro; Table of Contents; About the Author; About the Technical Reviewer; Acknowledgments; Introduction; Chapter 1: The Sense of Style; Why a Style Guide?; Understanding Beats Obedience; Good Guidance from Bad Code; What About Testability?; Complexity Explosions; Summary; Chapter 2: Designing Functions Using Types; Miles and Yards (No, Really!); Converting Miles and Yards to Decimal Miles; How to Design a Function; Sketch the Signature of the Function; Naïvely Code the Body of the Function; Review the Signature for Type Safety; Review and Refine; A Final Polish; Recommendations; Summary.
- ExercisesExercise Solutions; Chapter 3: Missing Data; A Brief History of Null; Option Types versus Null; Consuming Option Types; Pattern Matching on Option Types; The Option Module; The Option.defaultValue Function; The Option.iter Function; Option.map and Option.bind; The Option.map Function; The Option.bind Function; Option Type No-Nos; Designing Out Missing Data; Interoperating with the Nullable World; Leaking In of Null Values; Defining a SafeString Type; Using Option.ofObj; Using Option.ofNullable; Leaking Option Types and DUs Out; Using Option.toObj; Using Option.toNullable.
- The Future of NullThe ValueOption Type; Recommendations; Summary; Exercises; Exercise Solutions; Chapter 4: Working Effectively with Collection Functions; Anatomy of a Collection Function; Picking the Right Collection Function; Detailed Collection Function Tables; Practicing with Collection Functions; Exercise Setup; Single Collection Function Exercises; Multiple Collection Function Exercises; Partial Functions; Coding Around Partial Functions; Using the "try" Idiom for Partial Functions; Consuming Values from try ... Functions; Try ... Function Exercises; Functions for Other Kinds of Collections.
- When the Collection Function Is MissingCommon Mistakes; Recommendations; Summary; Exercise Solutions; Chapter 5: Immutability and Mutation; These Folks Are Crazy!; Classic Mutable Style; Immutability Basics; Common Mutable Patterns; Linear Search; Guarded Linear Search; Process All Items; Repeat Until; Find Extreme Value; Summarize a Collection; Recommendations; Summary; Exercises; Exercise Solutions; Chapter 6: Pattern Matching; Weaving Software with Patterns; Pattern Matching Basics; When Guards; Pattern Matching on Arrays and Lists; Pattern Matching on Tuples; Pattern Matching on Records.
- Pattern Matching on Discriminated UnionsPattern Matching on DUs in Function Parameters; Pattern Matching in Let Bindings; Pattern Matching in Loops and Lambdas; Pattern Matching and Enums; Active Patterns; Single Case Active Patterns; Multi-Case Active Patterns; Partial Active Patterns; Parameterized Active Patterns; Pattern Matching with ' & '; Pattern Matching on Types; Pattern Matching on Null; Recommendations; Summary; Exercises; Exercise Solutions; Chapter 7: Record Types; Winning with Records; Record Type Basics; Record Types and Immutability; Default Constructors, Setters, and Getters.