Haskell Cookbook


Book Description

Save time and build fast, functional, and concurrent application using Haskell About This Book Comprehensive guide for establishing a strong foundation in Haskell and developing pragmatic code Create a full fledged web application using Haskell Work with Lens, Haskell Extensions, and write code for concurrent and distributed applications Who This Book Is For This book is targeted at readers who wish to learn the Haskell language. If you are a beginner, Haskell Cookbook will get you started. If you are experienced, it will expand your knowledge base. A basic knowledge of programming will be helpful. What You Will Learn Use functional data structures and algorithms to solve problems Understand the intricacies of the type system Create a simple parser for integer expressions with additions Build high-performance web services with Haskell Master mechanisms for concurrency and parallelism in Haskell Perform parsing and handle scarce resources such as filesystem handles Organize your programs by creating your own types and type classes In Detail Haskell is a purely functional language that has the great ability to develop large and difficult, but easily maintainable software. Haskell Cookbook provides recipes that start by illustrating the principles of functional programming in Haskell, and then gradually build up your expertise in creating industrial-strength programs to accomplish any goal. The book covers topics such as Functors, Applicatives, Monads, and Transformers. You will learn various ways to handle state in your application and explore advanced topics such as Generalized Algebraic Data Types, higher kind types, existential types, and type families. The book will discuss the association of lenses with type classes such as Functor, Foldable, and Traversable to help you manage deep data structures. With the help of the wide selection of examples in this book, you will be able to upgrade your Haskell programming skills and develop scalable software idiomatically. Style and approach The book follows a recipe-based approach. Each recipe addresses specific problems and issues. The recipes provide discussions and insights to explain these problems.




Practical Haskell


Book Description

Get a practical, hands-on introduction to the Haskell language, its libraries and environment, and to the functional programming paradigm that is fast growing in importance in the software industry. This book contains excellent coverage of the Haskell ecosystem and supporting tools, include Cabal and Stack for managing projects, HUnit and QuickCheck for software testing, the Spock framework for developing web applications, Persistent and Esqueleto for database access, and parallel and distributed programming libraries. You’ll see how functional programming is gathering momentum, allowing you to express yourself in a more concise way, reducing boilerplate, and increasing the safety of your code. Haskell is an elegant and noise-free pure functional language with a long history, having a huge number of library contributors and an active community. This makes Haskell the best tool for both learning and applying functional programming, and Practical Haskell takes advantage of this to show off the language and what it can do. What You Will Learn Get started programming with Haskell Examine the different parts of the language Gain an overview of the most important libraries and tools in the Haskell ecosystem Apply functional patterns in real-world scenarios Understand monads and monad transformers Proficiently use laziness and resource management Who This Book Is For Experienced programmers who may be new to the Haskell programming language. However, some prior exposure to Haskell is recommended.




Cooking for Fitness: Eat Smart, Train Better


Book Description

Fuel your training the smart way. Boost your performance and achieve your body goals, with the right recipes and correct nutritional advice from rugby superstar and bestselling author James Haskell and one of the UK's top performance chefs and current England football chef, Omar Meziane. Clear, authoritative advice from James and Omar, the Cooking for Fitness dream team 79 everyday easy recipes to fuel your training Learn how the right nutrition can improve your performance Low-carb and high-carb meals with full nutritional breakdown - Easy to read and easy to use




Get Programming with Haskell


Book Description

Summary Get Programming with Haskell leads you through short lessons, examples, and exercises designed to make Haskell your own. It has crystal-clear illustrations and guided practice. You will write and test dozens of interesting programs and dive into custom Haskell modules. You will gain a new perspective on programming plus the practical ability to use Haskell in the everyday world. (The 80 IQ points: not guaranteed.) Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the Technology Programming languages often differ only around the edges—a few keywords, libraries, or platform choices. Haskell gives you an entirely new point of view. To the software pioneer Alan Kay, a change in perspective can be worth 80 IQ points and Haskellers agree on the dramatic benefits of thinking the Haskell way—thinking functionally, with type safety, mathematical certainty, and more. In this hands-on book, that's exactly what you'll learn to do. What's Inside Thinking in Haskell Functional programming basics Programming in types Real-world applications for Haskell About the Reader Written for readers who know one or more programming languages. Table of Contents Lesson 1 Getting started with Haskell Unit 1 - FOUNDATIONS OF FUNCTIONAL PROGRAMMING Lesson 2 Functions and functional programming Lesson 3 Lambda functions and lexical scope Lesson 4 First-class functions Lesson 5 Closures and partial application Lesson 6 Lists Lesson 7 Rules for recursion and pattern matching Lesson 8 Writing recursive functions Lesson 9 Higher-order functions Lesson 10 Capstone: Functional object-oriented programming with robots! Unit 2 - INTRODUCING TYPES Lesson 11 Type basics Lesson 12 Creating your own types Lesson 13 Type classes Lesson 14 Using type classes Lesson 15 Capstone: Secret messages! Unit 3 - PROGRAMMING IN TYPES Lesson 16 Creating types with "and" and "or" Lesson 17 Design by composition—Semigroups and Monoids Lesson 18 Parameterized types Lesson 19 The Maybe type: dealing with missing values Lesson 20 Capstone: Time series Unit 4 - IO IN HASKELL Lesson 21 Hello World!—introducing IO types Lesson 22 Interacting with the command line and lazy I/O Lesson 23 Working with text and Unicode Lesson 24 Working with files Lesson 25 Working with binary data Lesson 26 Capstone: Processing binary files and book data Unit 5 - WORKING WITH TYPE IN A CONTEXT Lesson 27 The Functor type class Lesson 28 A peek at the Applicative type class: using functions in a context Lesson 29 Lists as context: a deeper look at the Applicative type class Lesson 30 Introducing the Monad type class Lesson 31 Making Monads easier with donotation Lesson 32 The list monad and list comprehensions Lesson 33 Capstone: SQL-like queries in Haskell Unit 6 - ORGANIZING CODE AND BUILDING PROJECTS Lesson 34 Organizing Haskell code with modules Lesson 35 Building projects with stack Lesson 36 Property testing with QuickCheck Lesson 37 Capstone: Building a prime-number library Unit 7 - PRACTICAL HASKELL Lesson 38 Errors in Haskell and the Either type Lesson 39 Making HTTP requests in Haskell Lesson 40 Working with JSON data by using Aeson Lesson 41 Using databases in Haskell Lesson 42 Efficient, stateful arrays in Haskell Afterword - What's next? Appendix - Sample answers to exercise




Real World Haskell


Book Description

This easy-to-use, fast-moving tutorial introduces you to functional programming with Haskell. You'll learn how to use Haskell in a variety of practical ways, from short scripts to large and demanding applications. Real World Haskell takes you through the basics of functional programming at a brisk pace, and then helps you increase your understanding of Haskell in real-world issues like I/O, performance, dealing with data, concurrency, and more as you move through each chapter.




Scala Cookbook


Book Description

Save time and trouble when using Scala to build object-oriented, functional, and concurrent applications. With more than 250 ready-to-use recipes and 700 code examples, this comprehensive cookbook covers the most common problems you’ll encounter when using the Scala language, libraries, and tools. It’s ideal not only for experienced Scala developers, but also for programmers learning to use this JVM language. Author Alvin Alexander (creator of DevDaily.com) provides solutions based on his experience using Scala for highly scalable, component-based applications that support concurrency and distribution. Packed with real-world scenarios, this book provides recipes for: Strings, numeric types, and control structures Classes, methods, objects, traits, and packaging Functional programming in a variety of situations Collections covering Scala's wealth of classes and methods Concurrency, using the Akka Actors library Using the Scala REPL and the Simple Build Tool (SBT) Web services on both the client and server sides Interacting with SQL and NoSQL databases Best practices in Scala development




First, Catch


Book Description

“Eagle, a chef and food writer, uses a nine-dish lunch as the occasion to ruminate about cooking, and life” (New York Times Book Review). First, Catch is a cookbook without recipes, an invitation to journey through the digressive mind of a chef at work, and a hymn to a singular nine-dish festive spring lunch. In Eagle’s kitchen, open shelves reveal colorful jars of vegetables pickling over the course of months, and a soffritto of onions, celery, and carrots cook slowly under a watchful gaze in a skillet heavy enough to double as a murder weapon. Eagle has both the sharp eye of a food scientist as he tries to identify the seventeen unique steps of boiling water, as well as of that of a roving food historian as he ponders what the spice silphium tasted like to the Romans, who over-ate it to worldwide extinction. He is a tour guide to the world of ingredients, a culinary explorer, and thoughtful commentator on the ways immigration, technology, and fashion has changed the way we eat. He is also a food philosopher, asking the question: at what stage does cooking begin? Is it when we begin to apply heat or acid to ingredients? Is it when we gather and arrange what we will cook—and perhaps start to salivate? Or does it start even earlier, in the wandering late-morning thought, “What should I eat for lunch?” Irreverent and charming, yet also illuminating and brilliantly researched, First, Catch encourages us to slow down and focus on what it means to cook. With this astonishing and beautiful book, Thom Eagle joins the ranks of great food writers like M.F.K. Fisher, Alice Waters, and Samin Nosrat in offering us inspiration to savor, both in and out of the kitchen. Winner of the Fortnum and Mason’s Debut Food Book Award Shortlisted for the 2018 Andre Simon Food & Drink Book of the Year BBC Radio 4 Food Programme Best Foodbooks of 2018 Times Best Food Books of 2018 Financial Times Summer Food Books of 2018 “A contemplation of cooking and eating, a return to the great tradition of food writing inspired by M.F.K. Fisher’s The Gastronomical Me . . . Eagle writes with a wit and sharpness that can turn a chapter on fermenting pickles into a riff on death and decay while still making it seem like something you would like to put in your mouth.” —Mark Haskell Smith, Los Angeles Times “In two dozen short chapters linked like little sausages, he serves up a bounty of fresh, often tart opinions about food and cooking . . . Eagle is a natural teacher; his enthusiasm and broad view of food preparation is both instructive and inspiring . . . Eagle’s prose, while conversational in tone, is as crafted and layered as his cuisine. Never bland, it is also brightly seasoned with strong opinions . . . Rare among food writing, this book is bound to change the way you think about your next meal.” —Heller McAlpin, Christian Science Monitor




Haskell Programming from First Principles


Book Description

Haskell Programming makes Haskell as clear, painless, and practical as it can be, whether you're a beginner or an experienced hacker. Learning Haskell from the ground up is easier and works better. With our exercise-driven approach, you'll build on previous chapters such that by the time you reach the notorious Monad, it'll seem trivial.




Getting Started with Haskell Data Analysis


Book Description

Put your Haskell skills to work and generate publication-ready visualizations in no time at all Key FeaturesTake your data analysis skills to the next level using the power of HaskellUnderstand regression analysis, perform multivariate regression, and untangle different cluster varietiesCreate publication-ready visualizations of dataBook Description Every business and organization that collects data is capable of tapping into its own data to gain insights how to improve. Haskell is a purely functional and lazy programming language, well-suited to handling large data analysis problems. This book will take you through the more difficult problems of data analysis in a hands-on manner. This book will help you get up-to-speed with the basics of data analysis and approaches in the Haskell language. You'll learn about statistical computing, file formats (CSV and SQLite3), descriptive statistics, charts, and progress to more advanced concepts such as understanding the importance of normal distribution. While mathematics is a big part of data analysis, we've tried to keep this course simple and approachable so that you can apply what you learn to the real world. By the end of this book, you will have a thorough understanding of data analysis, and the different ways of analyzing data. You will have a mastery of all the tools and techniques in Haskell for effective data analysis. What you will learnLearn to parse a CSV file and read data into the Haskell environmentCreate Haskell functions for common descriptive statistics functionsCreate an SQLite3 database using an existing CSV fileLearn the versatility of SELECT queries for slicing data into smaller chunksApply regular expressions in large-scale datasets using both CSV and SQLite3 filesCreate a Kernel Density Estimator visualization using normal distributionWho this book is for This book is intended for people who wish to expand their knowledge of statistics and data analysis via real-world examples. A basic understanding of the Haskell language is expected. If you are feeling brave, you can jump right into the functional programming style.




Programming in Haskell


Book Description

Haskell is one of the leading languages for teaching functional programming, enabling students to write simpler and cleaner code, and to learn how to structure and reason about programs. This introduction is ideal for beginners: it requires no previous programming experience and all concepts are explained from first principles via carefully chosen examples. Each chapter includes exercises that range from the straightforward to extended projects, plus suggestions for further reading on more advanced topics. The author is a leading Haskell researcher and instructor, well-known for his teaching skills. The presentation is clear and simple, and benefits from having been refined and class-tested over several years. The result is a text that can be used with courses, or for self-learning. Features include freely accessible Powerpoint slides for each chapter, solutions to exercises and examination questions (with solutions) available to instructors, and a downloadable code that's fully compliant with the latest Haskell release.