We may earn an affiliate commission when you visit our partners.
Packt Publishing

What makes functional programming great?

Let’s dive into this course and figure out the reason for the buzz around functional programming.

In this Video Learning Path, we study a purely functional programming language— Haskell—and discover its capabilities.

Packt’s Video Learning Paths are a series of individual video products put together in a logical and stepwise manner such that each video builds on the skills learned in the video before it.

Read more

What makes functional programming great?

Let’s dive into this course and figure out the reason for the buzz around functional programming.

In this Video Learning Path, we study a purely functional programming language— Haskell—and discover its capabilities.

Packt’s Video Learning Paths are a series of individual video products put together in a logical and stepwise manner such that each video builds on the skills learned in the video before it.

Haskell is a powerful and well-designed functional programming language designed to work with complex data. Its emphasis on purity makes it easier to create rock-solid applications that stay maintainable and error-free even as they grow in scale.

In this Learning Path, you will start with learning the fundamentals and building blocks of Haskell programming language with special emphasis on functional programming.

You will learn how to solve programming problems and gain hands-on experience of creating an application. You will then move on to learn how to write expressions and high-order functions. We will then go on to discuss two other structured forms of interaction: streaming libraries and functional reactive programming.

By the end of this course, you’ll have an in-depth knowledge of various aspects of Haskell, allowing you to make the most of functional programming in Haskell.

To ensure that you get the best of the learning experience, in this Learning Path we combine the works of some of the leading authors in the business.

About the Author

Richard Cook is a staff software engineer at Tableau Software working on high-performance relational database systems. He works primarily in C++ but has experience in a broad range of languages and technologies. He frequently applies functional programming and Haskell experience in his daily work. He organizes the Seattle Area Haskell Users’ Group and is an active member of the Seattle functional programming community. He is currently working on developing a machine learning framework for Haskell.

Hakim Cassimally learned the basics of Lisp 15 years ago and has been interested in functional programming ever since. After Audrey Tang developed the first prototype of Perl6 in Haskell (Pugs), he got seriously interested in Haskell and has written, spoken, and evangelised about learning and writing Haskell since 2006.

Samuel Gélineau is a Haskell developer with more than 10 years of experience in Haskell Programming. He has been blogging about Haskell for about the same time. He has given many talks at Montreal’s Haskell Meetup, and is now co-organizer.

Samuel is a big fan of functional programming, and spends an enormous amount of time answering Haskell questions on the Haskell subreddit, and as a result has a good idea of the kind of questions people have about Haskell, and has learned how to answer those questions clearly, even when the details are complicated.

Enroll now

What's inside

Learning objectives

  • Discover how functional programming addresses complexity
  • See a comparison of functional programs with traditional imperative programs
  • Learn the basics of haskell datatypes and functions
  • Write and deploy a simple web application
  • Structure larger haskell programs
  • See how to model your problem domain with precise types and how to reap the benefits of doing so

Syllabus

Fundamentals of Practical Haskell Programming

This video provides an overview of the entire course.

This video takes the user through the steps required to install the Haskell Stack build tool on Windows using Windows 10 Pro as an example.

Read more

This video takes the user through the steps required to install the Haskell Stack build tool on Mac OS using Mac OS X 10.10.5 Yosemite as an example.

This video takes the user through the steps required to install the Haskell Stack build tool on Linux using Ubuntu 12.04.5 LTS as an example.

This video will develop motivation for learning a new approach to software development and a new and decidedly different programming language.

This video will outline the approach to managing complexity that functional programming FP encourages.

This video will talk about what Haskell has in common with other functional programming languages as well as the ways in which it is different.

This video will demonstrate some more realistic programs, incrementally built up from simpler programs. It will run them in GHC’s interpreted mode. We will see more Haskell syntax encounter more functions from Haskell’s standard prelude.

Haskell is a whitespace-sensitive programming language. It’s worth gaining some comfort with the indentation rules, even though they correspond—for the most part—to the “obvious” way to lay a program out. We’ll relate layout to lexical scoping of names.

GHCi and Interactive Haskell

Haskell employs a non-strict evaluation strategy which can be strange for newcomers to the language. Furthermore, we will inevitably write buggy code. GHCi has useful debugging capabilities that can allow to address both of these concerns.

We will drill deeper into values, function application and composition, and the various ways to declare functions.

So far, we have only skimmed over types and type signatures. You need to know enough to be able to read function declarations and build our own functions and values.

We’ve looked at built-in types and values and functions that use them; you need to learn how to define our own composite data types. This will use Haskell’s support for user-defined algebraic data types.

Haskell’s primary mechanism for implementing abstract data types is the type class. We need to know about some of the common built-in type classes as well as how to implement our own type classes and type class instances.

You learn all about declaring our own ADTs and creating values for them. Before we can really consume ADTs, you need to know how to extract values from them using pattern matching.

Learning Haskell Programming

This video provides overview of the entire course.

The aim of this video is to introduce how to install Haskell on your computer.

The aim of this video is to introduce how to install Haskell on OS X.

The aim of this video is to introduce how to install Haskell on Windows

The aim of this video is to introduce how to install Haskell on Linux.

We want to get started with Haskell in a quick and engaging way, without having to start with a long lecture on syntax. So, to develop our familiarity with Haskell, we'll explore some of the basics, such as how to use and manipulate numbers and strings using 'ghci,' the interactive interpreter.

It's hard to write interesting programs with just simple types such as strings and numbers. In this video, we'll look at built-in data structures such as Lists and Tuples, and see how we might do a simple dictionary lookup using built-in functions and the Maybe type.

The interactive interpreter is a great tool, but we're not going to be able to write longer programs without breaking our text editor. In this video, we'll look at how to use ghci along with our source code files.

You can't do "Functional Programming" without functions. In this video, you'll learn about how to declare functions in Haskell and some of the important characteristics of Haskell functions—how they work with types, currying, and point-free style.

If you're worried that being a "strongly typed" language meant that Haskell's types would be restrictive, never fear! In this video, we'll see how to define not just synonyms, but new types, including recursive ones!

Now we've created our new data-type, how do we manipulate the data inside it? In this video, you'll learn how to calculate the Expression values that we created in the previous video, and look at how to do pattern matching on lists.

To make sure we're taking advantage of a solid structure to develop a more complicated application on, we'll create a project with 'stack.' We'll see how to structure our main module, library functions, and tests and look at how to develop, compile, and test the project.

In this video, we'll take the first steps towards declaring and displaying a simple grid of letters.

So we want to search the grid from left to right, right to left, top to bottom, and diagonally... phew! Let's keep things simple for now by searching just from left to right. We'll explore list manipulation functions and the similarities between the Bool and Maybe types.

Though we can now search the grid horizontally, we want to do it in all directions. The easiest way to do this isn't to make our function more complicated, but rather to learn how to transform our grid! We'll use a toolkit including 'map', 'reverse', 'transpose', and our own recursive functions to do this.

Although Haskell's type system by itself gives you a lot of reassurance that you're writing correct code, good unit tests can help you maintain and understand your code even better.

You will learn how to associate every character on the word grid with a set of coordinates such as (2, 3) pointing at its position by row and column. We can accomplish this by learning more about Haskell's list type, including how to work with infinite lists, repeat values, iterate them with the List monad and list comprehensions, and join lists together with zip.

Using the grid coordinates from the previous video, we will explore how to declare a Cell datatype and incorporate that into our code. This will also give us a good experience of refactoring code. We'll do this using Haskell's type system.

In the previous video, we saw that the search functions couldn't be refactored in a simplistic, mechanical way. We now have to think about how to change a simple string search using 'isInfixOf' into something that searches on characters, but returns a complex Cell type.

The moment we've all been waiting for: we'll now turn all of our hard work learning about functions and data types into an actual game that we can play!

While we can now play our game, it still has a few rough edges. We'll now polish off a few of these. First, we want to create a random jumble of characters in the part of the grid that we're currently displaying with "underscore" characters. Next, we want to highlight each of the found words by uppercasing them.

Mastering Haskell Programming

This video gives an overview of the entire course.

In this video, we will install everything you will need in order to follow along with the code I'll be presenting during the course.

In this video, we will look at the wide variety of side-effects supported by the IO monad.

In this video, you will learn the subtleties of exception handling in Haskell, including why throwing exceptions is one of the only side-effect which isn't tracked by Haskell's type system.

Fewer Sins Using the Free Monad

In this video, you will learn how and when to use unsafePerformIO to execute side-effects within pure code.

In this video, we will examine how lazy IO is implemented, and how the same underlying mechanism can be used to express effectful stream transformations

In this video, we introduce streams and demonstrate how laziness makes it easy to implement streaming algorithms in Haskell.

In this video, we explore the consequence of a design in which streams are allowed, guaranteed, or forbidden from terminating after a finite number of elements, and similarly for stream transformers terminating after a finite number of steps.

In this video, we explore two variants of a callback-based APIs: push-based and pull-based.

In this video, we explore another alternative API in which the focus is on the streams instead of the stream transformers.

In this video, we will introduce the fundamental abstractions on which Functional Reactive Programming is based.

In this video, we look at the way in which FRP libraries handle state, and compare this approach to the way in which state is handled by traditional callback-based systems.

In this video, we look at FRP operators which allow the FRP network to be changed dynamically.

In this video, we look at three ways to specialize the type of the switch operator in order to eliminate time leaks.

In this video, we look at the properties of time which are either required or provided by FRP implementations.

What is "Parallel Programming in Haskell" about, and how does it differ from "Concurrent Programming in Haskell?" We answer those questions by clarifying the meaning of a few terms which are frequently confused.

How to specify which parts of an algorithm should be executed in parallel?

In this video, we turn laziness from a source of bugs into a source of parallelism opportunities.

In this video, we see how purity and immutability makes Haskell a great fit for writing parallel algorithms.

In this video, you will learn how to write programs whose outcome is deterministic even though the interleaving of its threads is not.

In this video, we look at a generalization of IVars which preserves determinism while allowing more than one thread to modify each variable.

In this video, we look at a few gotchas when writing code which forks threads.

In this video, you will learn how to turn an asynchronous API into a synchronous API and vice versa.

If our problem is not composed of smaller identical subproblems, can we still benefit from concurrency?

In this video, we draw inspiration from laziness in order to delay blocking for child thread until the last possible moment.

In this video, we introduce a way for threads to sleep until another thread wakes them up.

In this video, we introduce software transactional memory, a radically simpler way to write concurrent programs.

In this video, we see how purity and effect-tracking makes Haskell a great fit for writing concurrent algorithms.

In this video, we show that while writing code in the style of a combinator library has advantages, making it easier to write distributed programs is not one of them.

In this video, we investigate whether writing code in the style of a monad transformer stack also makes it harder to write distributed programs.

How can we use more than one architectural style, such as combinator libraries or monad transformers, in the same Haskell program?

In this video, we examine whether microservices are a good fit for a distributed Haskell application.

In this video, we optimize the set of requests being sent to a number of other services.

In this video, we introduce a different way to structure a distributed application, by launching remote threads instead of performing remote calls.

This video introduces data structures which are designed to cope with the uncertainties of communication in a distributed application.

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Explores functional reactive programming, which is useful for building interactive and responsive applications, especially in domains like game development and user interface design
Covers parallel and concurrent programming in Haskell, which is essential for writing efficient and scalable applications that can take advantage of multi-core processors and distributed systems
Features content from multiple authors, which may provide a range of perspectives and approaches to learning Haskell and functional programming
Requires installing the Haskell Stack build tool, which may present a barrier to entry for learners unfamiliar with command-line tools or software development environments
Teaches Haskell, which, while powerful, has a smaller community and fewer job opportunities compared to more mainstream languages like Java or Python

Save this course

Save Learning Path: Haskell: Functional Programming and Haskell to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Learning Path: Haskell: Functional Programming and Haskell with these activities:
Review Functional Programming Concepts
Reinforce your understanding of functional programming principles before diving into Haskell. This will make grasping Haskell's specific implementation easier.
Browse courses on Functional Programming
Show steps
  • Read articles or watch videos explaining functional programming concepts.
  • Compare and contrast functional programming with imperative programming.
  • Identify the core tenets of functional programming.
Read 'Get Programming with Haskell'
Supplement the course with a book that provides a gentler introduction to Haskell. This will help solidify your understanding of the core concepts.
Show steps
  • Obtain a copy of 'Get Programming with Haskell'.
  • Work through the examples and exercises in the book.
  • Relate the book's content to the course material.
Solve Haskell Koans
Reinforce your understanding of Haskell syntax and concepts through practice. This will improve your ability to write Haskell code fluently.
Browse courses on Haskell
Show steps
  • Find a set of Haskell Koans online.
  • Work through the Koans, writing code to pass each test.
  • Reflect on the concepts learned from each Koan.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Read 'Haskell Programming from First Principles'
Expand your knowledge of Haskell with a comprehensive textbook. This will provide a deeper understanding of the language's features and capabilities.
Show steps
  • Obtain a copy of 'Haskell Programming from First Principles'.
  • Work through the book's chapters and exercises.
  • Experiment with the concepts learned in the book.
Write a Blog Post on a Haskell Concept
Deepen your understanding of a specific Haskell concept by explaining it to others. This will force you to clarify your own understanding.
Browse courses on Haskell
Show steps
  • Choose a Haskell concept that you want to explain.
  • Research the concept thoroughly.
  • Write a clear and concise blog post explaining the concept.
  • Publish the blog post online.
Build a Simple Command-Line Tool in Haskell
Apply your Haskell knowledge to build a practical application. This will solidify your understanding of Haskell's features and libraries.
Browse courses on Haskell
Show steps
  • Choose a simple command-line tool to build (e.g., a to-do list manager).
  • Design the tool's functionality and user interface.
  • Implement the tool in Haskell.
  • Test and debug the tool.
Contribute to a Haskell Open Source Project
Gain practical experience and contribute to the Haskell community. This will expose you to real-world Haskell code and development practices.
Browse courses on Haskell
Show steps
  • Find a Haskell open source project that interests you.
  • Read the project's documentation and code.
  • Identify a bug or feature that you can contribute.
  • Submit a pull request with your changes.

Career center

Learners who complete Learning Path: Haskell: Functional Programming and Haskell will develop knowledge and skills that may be useful to these careers:
Software Developer
A software developer designs, develops, and maintains software applications, using their knowledge of programming languages and software development principles. This course, focusing on Haskell and functional programming, helps a software developer build a strong foundation in a paradigm that emphasizes purity, maintainability, and error-free code. This will allow a software developer to create reliable applications, especially when working with complex data. The course teaches how to solve problems using Haskell, a language that encourages clear, concise solutions. The exploration of high-order functions, streaming libraries, and functional reactive programming further enhances the software developer's ability to design responsive, maintainable, and scalable programs.
Algorithm Developer
Algorithm developers design and implement algorithms to solve complex problems. This role requires the ability to create efficient, reliable, and maintainable solutions. This course in functional programming with Haskell is beneficial to an algorithm developer. The course helps them in developing clear, correct, and performant algorithms. The course explores Haskell’s approach to dealing with complex data, and the course's approach of modeling problems with precise types. Furthermore, the course’s coverage of streams and functional reactive programming is relevant to designing algorithms for handling data that changes over time.
Academic Instructor
An academic instructor teaches computer science at the university level. This course is particularly helpful for an academic instructor who wants to teach functional programming concepts to their students, as it offers a deep dive into Haskell. The course's focus on Haskell's foundations gives an instructor a comprehensive background. The course’s instruction on problem-solving with Haskell, combined with the discussions of various programming paradigms, will enable an academic instructor to teach various aspects of programming. The content on high-order functions, streaming libraries, and functional reactive programming add depth to an instructor’s understanding of functional programming concepts.
Web Application Developer
A web application developer builds web-based software, focusing on both front-end and back-end development. This course, focused on Haskell and functional programming, helps a web application developer learn how to build scalable and maintainable web applications. The course teaches how to solve problems with Haskell, a language known for its clear and concise solutions. The course’s exercises of deploying a simple web application will provide hands-on experience. Moreover, the course’s discussion of high-order functions, along with functional reactive programming, will help a web application developer design responsive user interfaces.
Financial Software Engineer
A financial software engineer develops software for financial applications, often with a focus on high reliability and performance. This course on functional programming and Haskell helps a financial software engineer because the focus on purity and maintainability translates directly to financial software that must be both reliable and robust. The course's emphasis on precise types can help a financial software engineer model complex financial instruments. The course's coverage of concurrency and parallelism is useful in developing high-throughput financial systems. Haskell helps model stateful interactions, which is common in financial modeling and processing.
Game Developer
A game developer creates video games, often working on complex systems involving real-time interactions. This course on Haskell and functional programming can help a game developer to write modular and efficient code. The course’s emphasis on pure functions can translate to highly testable game logic, while the course's coverage of functional reactive programming is useful for handling game state changes as well as user input. The course teaches how to structure larger Haskell programs which is beneficial when developing large game applications. A game developer interested in performance may find the approach to concurrency and parallelism taught in this course to be very beneficial.
Data Scientist
A data scientist analyzes large datasets to extract insights and inform decision-making. This career path benefits from a thorough grasp of functional programming since it promotes concise and maintainable data processing pipelines. This course, with its focus on Haskell, can be particularly helpful to a data scientist by teaching them how to handle complex data through functional techniques. The course's emphasis on precise types helps a data scientist model their problem domains. The course explores streaming libraries, which are particularly useful in data analysis. Additionally, the course's coverage of Haskell's approach to concurrency and parallelism is useful for handling large datasets.
Research Scientist
A research scientist conducts scientific research, often involving the development of new tools or methods. This course, focusing on Haskell and functional programming, may be helpful to a research scientist who wants to implement their ideas in code. The course emphasizes clarity, which is important when translating theoretical research into practical code. The course's focus on precise types helps them model their problem domains directly in code. The course's coverage of functional reactive programming may be useful when analyzing complex systems. The parallel and concurrent programming methods taught in the course are highly valuable for data processing and algorithm research.
Quantitative Analyst
A quantitative analyst develops mathematical and statistical models for financial markets. This field benefits from a thorough grasp of functional programming, due to its ability to aid in developing maintainable and robust models. This course, with its focus on Haskell, may be helpful to a quantitative analyst by teaching them how to handle complex data with functional techniques. The course’s emphasis on precise types helps them in the modeling of financial instruments. The course's exploration of streaming libraries and functional reactive programming is useful for simulating market conditions. Also, an understanding of Haskell's concurrency features may be helpful when developing high-performance trading systems.
Systems Programmer
A systems programmer works on the low-level software that manages hardware resources. Functional programming, as taught in this course with Haskell, may be useful to a systems programmer because of its focus on purity, which is valuable when dealing with intricate hardware interactions. The course provides systems programmers with the ability to write highly reliable and maintainable code, particularly as the complexity of the systems they are working with grows. The course's coverage of concurrent and parallel programming techniques using Haskell can assist in the development of multi-threaded software. Understanding how Haskell handles state is crucial in managing hardware resources effectively and consistently.
Machine Learning Engineer
A machine learning engineer builds and deploys machine learning models. Functional programming, as explored in this Haskell course, may be helpful for a machine learning engineer because its emphasis on immutability and purely functional transformations is well-suited to data processing pipelines. The course’s focus on the foundations of the Haskell language can help one write clear code. The course’s exploration of streams and concurrency is crucial when working with large datasets. The course’s focus on modeling problem domains with precise types may help when creating machine learning models.
Database Developer
A database developer designs and implements databases and their related systems. Functional programming, as taught in this course with Haskell, may be useful to a database developer because of its emphasis on immutability, which helps with data integrity. The course’s instruction on problem-solving with Haskell can help a database developer write and maintain concise and correct data manipulation logic. The course's coverage of concurrency and parallelism is beneficial to writing robust database systems. Furthermore, the course’s approach to managing state may help a database developer design more predictable databases.
Compiler Engineer
A compiler engineer develops compilers, tools that translate programming languages into machine code. Functional programming, as taught by this course on Haskell, may be helpful to a compiler engineer. The course's exploration of language features and implementation details can help with compiler design. The course will help a compiler engineer understand advanced type systems and program transformations. Understanding how the Haskell language is structured, including its support for user-defined algebraic data types and type classes, is crucial for designing a compiler. The course's focus on concurrency is relevant to compiler optimizations.
Embedded Systems Engineer
An embedded systems engineer designs software for devices with limited resources. This course on Haskell and functional programming may be useful to an embedded systems engineer. The course's focus on developing reliable and concise code may improve the stability of embedded software. The course teaches how to manage complex data, which is important when dealing with hardware interactions. The course's coverage of concurrency may be useful when managing multiple tasks in an embedded system. Further, the course’s approach to state management will help an embedded systems engineer design predictable applications.
DevOps Engineer
A DevOps engineer manages the infrastructure and tools required to develop and deploy software. This role benefits from a comprehensive understanding of programming principles, including functional programming. This course, which teaches Haskell, a language known for its reliability and predictability, can be helpful to a DevOps engineer. The course teaches how to write maintainable code which can be helpful in automating deployment procedures. The course's coverage of concurrent and parallel programming may help a DevOps engineer create faster, more efficient automation tools. The course’s approach to managing complexity will translate to more efficient systems.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Learning Path: Haskell: Functional Programming and Haskell.
Provides a practical, hands-on introduction to Haskell. It's designed for programmers with little to no prior experience in functional programming. The book covers the fundamentals of Haskell, including data types, functions, and type classes. It great resource for solidifying the concepts taught in the course.
Comprehensive guide to Haskell programming. It covers a wide range of topics, from the basics of syntax and data types to advanced concepts like monads and type families. It valuable resource for anyone who wants to learn Haskell in depth. This book is more valuable as additional reading than as a current reference.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser