Soar with Haskell The Ultimate Beginners' Guide to Mastering Functional Programming from the Ground Up
Build powerful software solutions and develop proficiency in Haskell, from understanding the foundational principles through to mastering advanced functional programming concepts Key Features Learn from an expert lecturer and researcher who knows all the ins and outs of Haskell Develop a clear under...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing, Limited
2023.
|
Edición: | 1st edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009790328806719 |
Tabla de Contenidos:
- Cover
- Title page
- Copyright and credits
- Dedication
- Contributors
- Table of contents
- Preface
- Part 1: Basic Functional Programming
- Chapter 1: Functions
- Technical requirements
- What is FP?
- Programming with functions
- Brief history of FP
- Haskell
- Other contemporary FP languages
- Prominent application areas
- Writing basic functions
- Our first function
- A two-parameter function
- Custom operators
- Programming with primitive types
- Int and Integer
- Float and Double
- Booleans
- Char and String
- Converting between primitive types
- Putting the type checker to work
- Checking function calls
- Checking function definitions
- Disambiguating overloaded functions
- Inferring types
- Combining functions
- Calling functions from within functions
- Naming intermediate results
- Local function definitions
- Summary
- Questions
- Further reading
- Answers
- Chapter 2: Algebraic Datatypes
- Enumerations
- A game of rock-paper-scissors
- Don't-care patterns
- Booleans revisited
- Records
- People
- Named fields
- Nested records
- Full-blown algebraic datatypes
- Shapes
- Cards
- Showing cards
- scParametric polymorphism
- The identity function
- The constant function
- Parametric ADTs
- Tuples
- Type synonyms
- Maybe
- Either
- The unit type
- Summary
- Questions
- Answers
- Chapter 3: Recursion
- Standard libraries
- Lists
- List syntax
- List syntax desugared
- Predefined list functions
- List comprehensions
- Strings revisited
- Custom list processing
- Recursive datatypes
- Arithmetic expressions
- Parametric recursive datatypes
- Structural recursion
- Structural recursion on lists
- Structural recursion on other algebraic datatypes
- Variants on structural recursion
- Primitive recursion
- Recursion on integers
- Additional parameters
- Varying parameters and the worker/wrapper structure
- Accumulation
- Recursion on nested datatypes
- Mutual recursion
- Simultaneous recursion on multiple structures
- Combining variations
- Non-structural recursion
- Non-termination
- Unbounded search
- Summary
- Questions
- Answers
- Chapter 4: Higher-Order Functions
- Abstracting over functions
- Dropping a prefix
- Sorting in ascending and descending order
- An abstraction for structural recursion
- Folding lists
- Folds for other algebraic datatypes
- Variations on structural recursion
- Common HOFs
- Taking instead of dropping
- Mapping
- Filtering
- Any and all
- Folding from the left
- Scanning left and right
- Writing compact code with HOF
- Standard deviation
- Odds and evens
- All you can buy
- Summary
- Questions
- Answers
- Part 2: Haskell-Specific Features
- Chapter 5: First-Class Functions
- Anonymous functions
- Anonymous function syntax
- Anonymous function use
- Multi-parameter anonymous functions
- Pattern matching without equations
- Currying and partial application