29,99 €
With software systems reaching new levels of complexity and programmers aiming for the highest productivity levels, software developers and language designers are turning toward functional programming because of its powerful and mature abstraction mechanisms. This book will help you tap into this approach with Haskell, the programming language that has been leading the way in pure functional programming for over three decades.
The book begins by helping you get to grips with basic functions and algebraic datatypes, and gradually adds abstraction mechanisms and other powerful language features. Next, you’ll explore recursion, formulate higher-order functions as reusable templates, and get the job done with laziness. As you advance, you’ll learn how Haskell reconciliates its purity with the practical need for side effects and comes out stronger with a rich hierarchy of abstractions, such as functors, applicative functors, and monads. Finally, you’ll understand how all these elements are combined in the design and implementation of custom domain-specific languages for tackling practical problems such as parsing, as well as the revolutionary functional technique of property-based testing.
By the end of this book, you’ll have mastered the key concepts of functional programming and be able to develop idiomatic Haskell solutions.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 584
Veröffentlichungsjahr: 2023
Soar with Haskell
The ultimate beginners’ guide to mastering functional programming from the ground up
Tom Schrijvers
BIRMINGHAM—MUMBAI
Copyright © 2023 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Kunal Sawant
Publishing Product Manager: Teny Thomas
Book Project Manager: Manisha Singh
Senior Editor: Nisha Cleetus
Technical Editor: Jubit Pincy
Copy Editor: Safis Editing
Proofreader: Safis Editing
Indexer: Hemanigini Bari
Production Designer: Shankar Kalbhor
Business Development Executive: Kriti Sharma
Developer Relations Marketing Executive: Shrinidhi Manoharan
First published: December 2023
Production reference: 1141223
Published by
Packt Publishing Ltd.
Grosvenor House
11 St Paul’s Square
Birmingham
B3 1RB, UK
ISBN 978-1-80512-845-8
www.packtpub.com
To my wife, Annemie, for her enduring support.
– Tom Schrijvers
Tom Schrijvers has been a professor of computer science at KU Leuven in Belgium since 2014, and previously from 2011 until 2014 at Ghent University in Belgium. He has over 20 years of research experience in programming languages and has co-authored more than 100 scientific papers. Much of his research focuses on functional programming and the Haskell programming language in particular; he has made many contributions to the language, its ecosystem, and applications, and chaired academic events such as the Haskell Symposium. At the same time, he has more than a decade of teaching experience (including functional programming with Haskell) and received several teaching awards.
I would like to thank the Haskell community who have created and fostered this amazing language. They have been a major inspiration. Of course, I am grateful to the Packt team who have followed the development of this book every step of the way. Many thanks also to Alexander Granin for his uplifting technical feedback. Finally, I am indebted to my employer, KU Leuven, who granted me a six-month sabbatical leave. That gave me the opportunity to write the first 10 chapters in the welcoming environment of Kellogg College in Oxford.
Alexander Granin, a functional programming expert, is renowned for his fundamental books Functional Design and Architecture and Pragmatic Type-Level Design. With over 15 years of experience spanning C++, Haskell, C#, and Python, he’s evolved from developer to software architect. As an accomplished international speaker, he delivered many talks on software design and functional programming. Alexander’s methodology, functional declarative design, provides a pragmatic knowledge of design patterns, principles, and best practices, useful for building applications with functional languages. His mission is to empower developers with practical insights and build a comprehensive software engineering discipline for Function Point (FP).
This part introduces you to the Haskell programming language. You will get an overview of the basic functional programming language features. In particular, you will start with the key concepts and functions, expanding into the data processed by functions (algebraic datatypes), the way to write loops with functions (recursion), and functions taking other functions as input (higher-order functions).
This part has the following chapters:
Chapter 1, FunctionsChapter 2, Algebraic DatatypesChapter 3, RecursionChapter 4, Higher-Order Functions