Haskell From Scratch Re-Opened!


This week we're taking a break from our Gloss/AI series to make a special announcement! Haskell from Scratch, our beginners course, is now re-opened for enrollment! We've added some more content since the last time we offered it. The biggest addition is a mini-project to help you practice your new skills!

Enrollment will only be open for another week, so don't wait! Next Monday, August 5th, will be the last day to sign up! Enrollments will close at midnight. Once you sign up for the course, you'll have permanent access to the course material. This includes any new content we add in the future. So even if you don't have the time now, it's still a good idea to sign up!

I also want to take this opportunity to tell a little bit of the story of how I learned Haskell. I want to share the mistakes I made, since those motivated me to make this course.

My History with Haskell

I first learned Haskell in college as part of a course on programming language theory. I admired the elegance of a few things in particular. I liked how lists and tuples worked well with the type system. I also appreciated the elegance of Haskell's type definitions. No other language I had seen represented the idea of sum types so well. I also saw how useful pattern matching and recursion were. They made it very easy to break problems down into manageable parts.

After college, I had the idea for a code generation project. A college assignment had taught me some useful Haskell libraries for the task. So I got to work writing some Haskell. At first things were quite haphazard. Eventually though, I developed some semblance of test driven development and product organization.

About nine months into that project, I had the great fortune of landing a Haskell project at my day job. As I ramped up on this project, I saw how deficient my knowledge was in a lot of areas. I realized then a lot of the mistakes I had been making while learning the language. This motivated me to start the Monday Morning Haskell blog.

Main Advice

Of course, I've tried to incorporate my learnings throughout the material on this blog. But if I had to distill the key ideas, here's what they'd be.

First, learn tools and project organization early! Learn how to use Stack and/or Cabal! For help with this, you can check out our free Stack mini-course! After several months on my side project, I had to start from scratch to some extent. The only "testing" I was doing was running some manual executables and commands in GHCI. So once I learned more about these tools, I had to re-work a lot of code.

Second, it helps a lot to have some kind of structure when you're first learning the language. Working on a project is nice, but there are a lot of unknown-unknowns out there. You'll often find a "solution" for your problem, only to see that you need a lot more knowledge to implement it. You need to have a solid foundation on the core concepts before you can dive in on anything. So look for a source that provides some kind of structure to your Haskell learning, like a book (or an online course!).

Third, let's get to monads. They're an important key to Haskell and widely misunderstood. But there are a couple things that will help a lot. First, learn the syntactic patterns of do-syntax. Second, learn how to use run functions (runState, runReaderT, etc.). These are how you bring monadic expressions into the rest of your code. You can check out our Monads Series for some help on these ideas. (And of course, you'll learn all about monads in Haskell From Scratch!)

Finally, ask for help earlier! I still don't plug into the Haskell network as much as I should. There are a lot of folks out there who are more than willing to help. Freenode is a great place, as is Reddit and even Twitter!


There's never been a better time to start learning Haskell! The language tools have developed a ton in the last few years and the community is growing stronger. And of course, we've once again opened up our Haskell From Scratch Beginners Course! You don't need any Haskell experience to take this course. So if you always wanted to learn more about Haskell but needed more organization, this is your chance!

If you want to stay up to date with the latest at Monday Morning Haskell, make sure to Subscribe to our mailing list! You'll hear the latest about upcoming articles, as well as any new course offerings. You'll also get access to our Subscriber Resources.

Gloss Review!

For the last few months, we've been constructing a simple game using the Gloss library. This library provides a neat and tidy interface for us to construct game components and put them together. The game is available to build and fork on our Github Repository. Here's a quick review of everything we've done:

Part 1: Overview of the Gloss library, constructing basic simulations and games

Part 2: Creating our maze type

Part 3: Generating random mazes using Depth-First-Search

Part 4: Victory Status Screen

Part 5: Serializing and parsing a maze

Part 6: Refactoring using Compile Driven Development

Part 7: Using Mutable Arrays for maze construction

Part 8: Adding enemies to the maze

Part 9: Making enemies more intelligent with Breadth-First-Search

Part 10: Adding a stun power to fight back against enemies

Part 11: Parameterizing the application and saving the world state

Part 12: Re-loading the world state, adding command line parameters

Part 13: Adding a drill power-up to take shortcuts through the maze

In this series, we explored some cool algorithmic concepts. We saw how to use the state monad for breadth first search and depth first search. We also explored mutable arrays, which aren't used that often in Haskell. If you're new to Haskell, it's good to get familiar with how some of these algorithms work.

We also emphasized using a methodical development approach. The Gloss architecture enables us to have a simple process for adding new features to the game. Combining this with compile driven development is powerful combination for rapid iteration.

We're probably not going to add any more core features to this game. But that doesn't mean we're done working with it! We're going to continue using the game as a platform for learning about interesting concepts and algorithms. Expect to see some articles related to search algorithms, AI development, and game architecture coming soon!

Until then, don't forget that you can subscribe to Monday Morning Haskell! You'll hear about our upcoming articles through our monthly newsletter. You'll also get access to our subscriber resources! There's plenty to learn both for beginners and more advanced Haskellers!

Haskell Data Types Review!

This week we're taking a quick break from new content. We've added our new series on Haskell's data system to our permanent collection. You can find it under the beginners panel or check it out here! This series had five parts. Let's take a quick review:

  1. In part 1 we reviewed the basic way to construct data types in Haskell. We compared this to the syntax of other langauges like Java and Python.
  2. Part 2 showed the simple way we can extend our Haskell types to make them sum types! We saw that this is a more difficult process in other languages. In fact, we resorted to making different inherited types in object oriented languages.
  3. Next, we demonstrated the concept of parametric types in part 3. We saw how little we needed to add to Haskell's definitions to make this work. Again, we looked at comparable examples in other languages as well.
  4. In part 4, we delved into Haskell's typeclasses. We compared them against inherited types from OO languages and noted some pros and cons.
  5. Finally, in part 5 we concluded the series by exploring the idea of type families. Our code was more complicated than we'd need in other languages. And yet, our code contains a lot more behavioral guarantees in Haskell than it does elsewhere. And we achieved this while still having a good deal of flexibility. Type families have a definite learning curve, but they're a useful concept to know.

As always keeping coming back every Monday morning for some new Haskell content! For more updates and our monthly newsletter, make sure you Subscribe! This will also give you access to our Subscriber Resources!

Happy New Years from MMH!


As 2018 comes to a close, I’d like to personally wish all my readers a happy new year! It’s been a big year for Monday Morning Haskell. We’re now more than two years old. We’ve grown a lot in readership, and tackled some very complex topics. We also released the first iteration of our Beginner’s Course, which will soon be re-opened!

New years is a time when I always like to get back to the basics a little bit. So for January, I’ve got a special series focusing on the simple things that drew me to Haskell in the first place. Haskell is a very different language from most. It has a lot of tools to express simple concepts that other languages struggle with.

We’ll look at things like type declarations, parametric types, and type families. We’ll compare the code required to express these concepts in Haskell and other languages. We’ll see the costs and benefits, and how Haskell gives us a lot more guarantees about how our code will work.

Besides our weekly blog posts, we've got some other big plans for 2019. We’re also looking to add another full-length course to our collection this summer! It will target a lot of the more advanced concepts we’ve gone through in this blog. You won’t want to miss it, so stay tuned!

To make sure you’re up to date with Monday Morning Haskell news, subscribe to our monthly newsletter! Subscribing will also give you access to our special subscriber resources! So don't miss out!

Purescript Series Now Available!

Last week we wrapped up our series on Purescript. At some point, we’ll come back to frontend web and tackle it from a more Haskell-centric perspective. But for now, we’ve added our our Purescript series as another permanent feature on our advanced page. You can take a look at that as well as our series on Elm. As a reminder, here’s the structure of that series:

  1. Part 1 covers the basics of Purescript. We see how to install it and how to solve simple problems.
  2. In part 2, we dig into some of the more complicated aspects of Purescript. We compare it to Haskell when it comes to elements like monads and typeclasses.
  3. In part 3, we get into the actual web usage of Purescript. We explore the basics of constructing a UI with the Halogen library. We also see how to architect our application to pass information around.
  4. We wrap up the series in part 4. In this part, we learn how to send web requests from our application. We also look at how to use routes to navigate between different pages.

Remember we also have plenty of resources for writing backend Haskell code! You can read our Haskell Web Series for some in-depth tutorials. You can also check out our Production Checklist for a slew of libraries for many different tasks!

And for any beginners out there, we have lots of material for you as well! Read our Liftoff Series and download our Beginners Checklist. They’ll teach you the basics of Haskell from the ground up!

Elm Series + Purescript Coming Up!

In the last few weeks, we've been quite busy learning about Elm. We're taking a quick break this week from new material. But we're pleased to announce that our Elm series is now a permanent fixture on the advanced section of the site! Here's a quick review of what we covered there:

  1. Part 1 covers the language basics. We learned how to install Elm, the basic syntax, and how it's different from Haskell.
  2. In part 2, we see Elm in its natural habitat, building a simple web application. We make a Todo list app that showcases how Elm's architecture works.
  3. Part 3 expands our vocabulary of Elm techniques. We use effects to incorporate randomness and send some HTTP requests.
  4. In the final part of the series, we learn the basics of navigation. We start by writing a very simple multi-page application. Then we see how the page changes hook into Elm's architecture.

Coming Up: Purescript!

But we're not done with functional frontend yet! Starting next week, we'll learn Purescript! Like Elm, it compiles to Javascript, but has a syntax very reminiscent of Haskell's. It incorporates even more of Haskell's language features than Elm. This makes it even easier to put our functional skills to use with it. So you won't want to miss this series!

If you'd like to stick to Haskell for now though, make sure to check out our other resources, like our Liftoff Series and our Web Skills Series. You can also subscribe to our newsletter and get access to all our awesome resources!

MMH Blog Archive!

We’re taking a quick breather this week on Monday Morning Haskell to announce a new website feature! Several readers have suggested it, so we now have the archive! You can scroll through the page and find all the different articles we’ve done over the last couple years. We’ve also implemented a tag system, so you can search for articles on specific topics. Our current tags list includes the following:

  1. Beginners
  2. Production
  3. Library
  4. Open Source
  5. AI
  6. Non-Technical
  7. Announcements

Take a look and let us know what you think!

Community Callouts

I’d also like to take a moment to call out some of the other excellent Haskell blog work going on in the community. I’ll give a special shoutout to Anuj Agarwal who listed us in his top 10 Haskell blogs. You can check out some of the other folks on that list as well. In particular, I enjoy Neil Mitchell’s blog as well as the material on Haskell Reddit and Haskell Weekly.


Next week we’ll start our exploration of frontend web development. This will involve looking at a couple other functional languages. Over the course of this series, we’ll explore both Elm and Purescript. We’ll see how both languages are similar to and different from Haskell. We’ll also see some ways we can integrate them with our Haskell code. You won’t want to miss this series!

And remember if you’re new to the community there are plenty of good resources out there to help you get off the ground! Take a look at our Beginners Checklist and our Liftoff Series for tips on getting started!

Announcing: Haskell From Scratch Beginners Course!


This week we have a huge announcement we’ve been working towards for a long time. One of the main goals of this blog has been to create content to make it easy for newcomers to learn Haskell. We’ve now reached the culmination of that goal with our brand new Haskell From Scratch course. This online course will teach you the basics of using and writing Haskell. It assumes no prior knowledge of Haskell, but you should have at least some programming background. To sign up, head over to the course page.

Course Overview

The course consists of seven modules. Each module has a series of video lectures and accompanying exercises. In the first module, we’ll go over the fundamental structure of the language. We’ll take an in-depth look at how we compose programs by using expressions. Then we’ll see how the type system affects what we can do with those expressions.

In module 2, we’ll try to build a deeper mastery of the type system by learning how to construct our own types. We’ll also see how Haskell’s typeclass system lets us capture common behavior between types.

Module 3 deals with lists and recursion. Haskell doesn’t use for-loops like you have in mainstream languages. Instead, we tend to solve problems with recursion. There's a clear, recognizable pattern to recursion. We'll use Haskell's list structure to help understand this pattern.

In module 4, we’ll take our first steps towards learning about monads and writing real programs. We’ll learn about the IO monad, whose functions allow us to do more interesting things. We'll see how to get user input, manipulate files and even use threads.

In module 5, we’ll take what we learned from writing IO code and apply it to learning about other monads. We’ll start by learning about other kinds of functional data structures. Then we’ll use these patterns to help us learn this most dreaded of Haskell concepts (it’s actually not bad!).

Module 6 deals with the complications of similar-looking data. We have many different ways of representing numbers or strings, for example. And each representation can have a different type. This presents a lot of unique challenges for us as Haskell developers. We’ll explore these more in this module.

Finally, we’ll wrap the course up by learning the "Haskell" approach to problem solving. We'll look at some common programming problems and see how to solve them in Haskell. We’ll consider paradigms like memoization and dynamic programming.

Besides the course material, there will also be a Slack group for this course. This will be a place where you can get help from myself or any of your fellow classmates!

Course Schedule

The course will launch on Monday, September 3rd, with the release of module 1. We will then release a new module each Thursday and Monday thereafter. Don’t worry if you’re busy on a particular week! You’ll be able to access all old content indefinitely.

Now, sign-ups for the course will end on Wednesday, August 29th! So don’t miss out! Head over to the course page and reserve your spot today! If you’re not sure yet about starting with Haskell, you can also download our Beginners Checklist. It’ll give you the tools you need to try the language out!

Series Spotlight: Haskell Web Skills!

Haskell has a reputation of being a neat language with cool concepts used a lot in academic research. But the dark side of this reputation is that people imagine it's unsuited for production use. But nothing could be further from the truth!

A common misconception about Haskell is that it “doesn’t have side effects.” Of course any language needs to have side effects to be effective. What makes Haskell unique isn’t that it doesn’t have side effects at all. What makes it unique (or at least uncommon) is that you have to encode side effects within the type system. This means you can know at compile time where the effects lie in your system.

To get a feel for how you can write normal programs with Haskell, you should read our Haskell Web Series. It will take you through the basics of building a simple web application using Haskell. We’ll highlight a couple specific libraries that allow you to do common web tasks.

In part 1, we’ll use the Persistent library to connect to a Postgresql database. This involves using a more complex concept called Template Haskell to create our database schema. That way, we can automatically generate the SQL statements we need.

In part 2, we’ll learn how to use the Servant library to create an HTTP server. We’ll also see how we can connect it to our database and make requests from there.

Next, we’ll use the Hedis library to connect to Redis. This will allow us to cache some of our database information. Then when we need it again, we won't have to go to our database!

Part 4 covers how we test such a complicated system. We’ll also see how to use Stack to connect our system with Docker so that our side services are easy to manage.

Finally, we wrap this series up in part 5, where we’ll look at some more complicated database queries we can make. This will require learning another library called Esqueleto. This cool library works in tandem with Persistent.

There are a lot of different libraries involved in this series. So it’s essential you know how to bring outside code into your Haskell application. To learn more about package management, you should also take our free Stack mini-course. It’ll help you learn how to create a real Haskell program and connect to libraries with ease.

And if you’ve never written Haskell before, now’s a great time to start! Download our Beginner’s Checklist for some tips!

Series Spotlight: Liftoff Series!

Learning Haskell, like learning anything, can be a long and sometimes difficult journey. But every journey starts with a first step! And when you take things step-by-step, it’s not too difficult to make progress. So what is the first thing you should do? That’s what our Liftoff Series is for!

If you’ve never written any Haskell before, this is a great place to start. We’ll walk you through the first steps of learning the language. You don't need to worry about any prerequisites. The series assumes no prior knowledge of Haskell, and walks you through installation. That said, it's important to have some background in programming.

In part 1 of the series, you’ll learn about expressions and types. These form the basic building blocks of Haskell as a language. The structure they create is a radical departure from most non-functional languages.

In part 2 of the series, we’ll learn about code modules and how to write your own Haskell source files. We’ll also learn some of the more complicated elements of function syntax in Haskell. For instance, we’ll explore the differences between how Haskell if statements work compared to other languages. We'll also see Haskell's other options for control flow.

In part 3, we’ll conclude by improving our mastery of the type system. Specifically, we’ll look at how we can create our own types. Again, this is very different from the process you might follow in other languages. But it’s also a lot easier and more flexible!

An excellent addendum to this series is our free Stack mini-course. This will help you learn how to use the Stack tool so you can start building your own Haskell programs. You’ll need this knowledge if you want to get beyond building simple toy projects, so take a look!

Coming Summer Attractions

Our recent blog series on GHC is now part of our permanent collection of material on the site! Check it out in the advanced section. As a reminder, here are the different parts of that series:

  1. Part 1 goes over how to set up our local development environment to use GHC. This part focuses on Windows but also has good advice for Mac and Linux Users.
  2. In part 2, we’ll set up a basic development cycle and make a simple change. We’ll also learn about the organization of the codebase.
  3. In the third part of the series, we’ll do some more serious hacking. We’ll look at adding some of our own keywords and adding a new syntactic construct.
  4. In the final part, we’ll look at how GHC handles issue tracking. This will lead to us submitting some code for a couple very simple issues.

What’s Next?

In the next few weeks, we’ve got a wide variety of content planned. We’ll be highlighting some more of our permanent content as well as showing some new tutorials. We’ll specifically look at a couple concepts we’ve handled in the past, but we’ll find new ways to build those programs. We’ve also got some more cerebral articles for how to take the next steps in your Haskell development. So stay tuned for more!

As always, if you’re new to Haskell, we’ve got some great resources to help you get started! Download our Beginners Checklist to get the language installed and discover some cool tools! For more language details, read our Liftoff Series!

And for you more experienced Haskell developers, take a look at our Production Checklist. It’ll give you some more ideas for advanced libraries to use for your projects!

Next up on MMH!

Exciting news! We’ve spent this week growing Monday Morning Haskell’s permanent content a bit more. Last week we finished our series on API integrations by looking at the Mailchimp service. But don’t fret if you missed it! It’s now available as a full series on the Advanced section of the website. Feel free to take a look and enjoy all the new Haskell tools at your disposal.

On the Beginner side of things, we’ve also added a new series on testing and profiling our code! First you’ll learn a little bit about the process of test driven development. Then you’ll learn some neat libraries for implementing it in Haskell. You’ll also see how to test performance in addition to correctness with profiling and the Criterion library.

Existing Series

As a reminder, here are all the existing series we have on the blog. For beginners:

  1. Liftoff Series - If you’ve never written any Haskell before, start here!
  2. The Haskell Brain - A few articles on overcoming some of Haskell’s psychological hurdles
  3. Functional Data Structures - Any Haskell author has to talk about monads at some point. This is our series teaching monads from the ground up. We start with other structures like functors that are easier to understand.

Then the more advanced topics include:

  1. Haskell Web Skills - Learn libraries for many skills including database management and writing a server.
  2. Haskell and AI - See why Haskell is a good fit for Machine Learning and AI. Then examine some of the libraries we can use to make it happen!
  3. Parsing with Haskell - Haskell is renowned for its parsing capabilities. Learn why by looking at three of the many parsing libraries Haskell offers to us.

What’s Next

Our API integrations series focuses on connecting to other helpful services. But most of these are only helpful in the first place if you have your Haskell code deployed on the internet. Since Haskell is still not common, many hosting services don’t support it well. In the next few weeks, we’ll look at how we can use sites like Heroku and AWS to deploy our Haskell code. We’ll also see a few other tricks we can use to enhance our deployment pipeline.

And remember, if you’ve never written Haskell before, now’s the best time to start! Download our Beginners Checklist and start your journey!

If you’ve toyed around with Haskell a bit but aren’t sure what to try next, you’re in luck! Take a look at our Production Checklist! It’ll give you some fresh ideas of libraries to learn and apply to your projects.

More Series + What's Coming Up!

In the past few weeks on Monday Morning Haskell, we’ve been very busy. We’ve gone over several different parsing libraries. We started with Applicative Parsing and then learned all about Attoparsec and Megaparsec. If you missed it, that series is now available as a permanent fixture on our advanced topics page! So make sure you check it out!

Monads Series

The parsing series made an important distinction between applicative code and monadic code. If these terms are still a little foreign to you, don’t worry! You’re in luck! We’ve also added a new series in our beginners section dedicated to monads and other abstract functional structures! You’ll start by learning about the basics of functors and applicative functors. Then you'll work your way up to all different kinds of monads!

Coming Up: APIs!

In the next few weeks, we’ve got more new material coming up on the blog! Starting next week, we’ll be learning to use APIs to connect to many different services using Haskell. We’ll start by sending SMS messages with the Twilio API. I recently worked with this API (in Haskell) at a Hackathon, so you’ll be able to learn from my afternoon of pains and frustrations!

After that, we’ll spend a couple weeks working with emails. We’ll use the Mailgun API to master the basics of triggering an email send from our Haskell code. Then we’ll see how we can combine this with the Mailchimp service to subscribe people to an email list!

All these APIs have complex side effects we need to manage. We’ll also want to be able to test the systems without these effects occurring. So once we’re done learning the basics, we’ll examine how we can write these kinds of tests.

So keep coming back every Monday morning for some new content! And speaking of emails and email lists, if you haven’t yet, you should subscribe to Monday Morning Haskell! You’ll get our monthly newsletter and you’ll also be the first to hear about any exciting offers!

Monday Morning Haskell: Upgraded!

Welcome to the new Monday Morning Haskell! We just went live with the latest changes to the website this week. So it’s time to announce what’s coming next. Our main project right now is converting older blog content into permanent, organized, series. We currently have two sections for these series. One is focused on beginners, the other on more advanced Haskellers.

Beginners Section

The Beginners Section will obviously focus on content for people who are new to Haskell. Right now, there are two series of articles. The first is our Liftoff series. If you have never programmed in Haskell before, this is the series for you! You'll learn how to install Haskell on your system, as well as the core language mechanics.

The second set of articles is our Haskell Brain series. This series focuses on the mental side of learning Haskell. It goes through the psychological hurdles many people face when starting Haskell. It also goes over some interesting general techniques for learning.

Advanced Section

The Advanced Section features content for those trying to make the step up from hobbyists to professional Haskellers. It incorporates two of our more recent series from the blog. First up is the Web Skills series. This series goes through some interesting libraries for tasks you might need when building a Web backend. For instance, you'll learn about the Persistent database library, the Servant API library, and some general testing techniques.

The advanced section also features a series on Haskell and machine learning. It starts off by making the case for why Haskell is a good fit for machine learning in general. Then it goes through some specific examples. One highlight of this series is a tutorial on the Haskell Tensor Flow bindings. It also gives some examples of using dependent types within Tensor Flow.

Resources Update

We've also made a big update to our subscriber-only resources. All the resources are available on the resources page. If you're a subscriber to our email list, you should have gotten an email with the password to this page! If you're not subscribed yet, you can still sign up for free! You'll get access to all of these:

  1. Beginner's Checklist – The newly revised version of our Getting Started Checklist will help you review some of the core concepts of Haskell. It will also point you towards some additional resources to help you learn even more!
  2. Production Checklist – This NEW resource lists a large number of libraries you can use for production tasks. It goes well beyond the set covered in the web skills series and gives a short summary of each.
  3. Recursion Workbook – This workbook contains a couple chapters of content that will teach you all about recursion. Then it offers 10 practice problems so you can put your skills to the test!
  4. Stack Mini-Course – This mini-course will walk you through the basics of the Haskell Stack tool so you can actually make your own projects!
  5. Servant Tutorial – At BayHac 2016 I gave a talk on the Servant library. If you're a subscriber, you can get the slides and the sample code for that talk.
  6. Tensor Flow Guide – This guide accompanies our Haskell AI series. It goes through all the details you need to know about getting the Haskell Tensor Flow library up and running.

If you subscribe, you'll also get our monthly newsletter! This will detail what's new on the blog, and what content you can expect in the future!

The Blog

Going forward, I'll be continuing to take some older blog content and form it into coherent series. Most of my weekly blog posts for the time being will focus on announcing when these are available. I do have quite a bit more fresh content planned for the future though, so stay tuned! In the meantime, if there's an old blog article you're trying to find, you can use our search functionality! I've added tags to each blog post to help you out!

So don't forget, if you want access to our awesome resources, sign up for free!