Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Haskell Cookbook

You're reading from   Haskell Cookbook Build functional applications using Monads, Applicatives, and Functors

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher Packt
ISBN-13 9781786461353
Length 396 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Yogesh Sajanikar Yogesh Sajanikar
Author Profile Icon Yogesh Sajanikar
Yogesh Sajanikar
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Foundations of Haskell FREE CHAPTER 2. Getting Functional 3. Defining Data 4. Working with Functors, Applicatives, and Monads 5. More about Monads 6. Working with Common Containers and Strings 7. Working with Relational and NoSQL Databases 8. Working with HTML and Templates 9. Working with Snap Framework 10. Working with Advanced Haskell 11. Working with Lens and Prism 12. Concurrent and Distributed Programming in Haskell

Introduction

We have worked on functions, higher order functions, and also worked with data types in Haskell. We have looked at functions such as map and filter in the context of the data type list. In many of these examples, we have taken a function that operates on data of type a and applied them in the context of the list of type a. Look at the following definition of map:

    map :: (a -> b ) -> [a] -> [b]

You can clearly see that we have taken a function that operates on data type a and produces b, and we converted it to a function that takes a list of a and produces a list of b (map :: (a -> b) -> ([a] -> [b])). Instead of the list of a, we can think of some parametric data type T a. Now, we can rewrite the declaration of map as follows:

    map :: (a -> b) -> T a -> T b

In short, the preceding definition of map applies to any data type T a, given...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at R$50/month. Cancel anytime