Skip to content

Latest commit

 

History

History
151 lines (106 loc) · 5.22 KB

README.md

File metadata and controls

151 lines (106 loc) · 5.22 KB

Applied Haskell 2018

Welcome to the Applied Haskell 2018 course outline. The content below is based on survey responses from the attendees. Note that there is more material below than will actually fit into two days! I've organized the material to prioritize the topics with the highest interest level. I'm leaving this page over-filled with content so that you can continue after the course finishes if desired.

For text-based communication for this course, we'll be using the #applied-haskell-2018 channel on the Functional Programming Slack.

Prepare for the training

You should get your system set up in advance so you're ready to get started.

  1. Download and install Stack. Instructions are available online. Make sure you have at least version 1.7.

  2. We're going to be using LTS 11.10). You may as well install an unnecessarily broad number of packages right off the bat: stack build --resolver lts-11.10 classy-prelude-yesod lens rio yesod-test foldl microlens-platform wai-conduit hspec

    • You may also find it convenient to run stack config set resolver lts-11.10 from outside of a project to set your global resolver to match.
  3. Make sure you can run the script below successfully. Save it to a file ending with .hs and then run stack filename.hs. On non-Windows systems, you can also do chmod +x filename.hs && ./filename.hs

#!/usr/bin/env stack
-- stack --resolver lts-11.10 script
main = putStrLn "Hello World!"

Note that the comment on line 2 above is necessary!

Pre-reading

tl;dr: Make you you understand monads, and read All About Strictness.

As mentioned above, we won't be able to cover everything we'd like in just two days. Some material will be taken as a prerequisite. For other topics, you will likely find it easier to familiarize yourself with the concepts before we drill in on them in the training.

Based on the responses, it seems that everyone attending is at least fairly solid in Haskell topics up to and including Functor/Applicative/Monad. If you'd like to test yourself on this, try out the following exercises:

  • Define fmap in terms of >>= and return
  • Define fmap in terms of <*> and pure
  • Define >>= in terms of Applicative instance and join
  • Define join in terms of >>=
  • Explain the intuition behind: what can you do with Monad and not Applicative?

If you'd like to brush up on these topics at all, I published a blog post which is a relatively short read-through. More generally, if you'd like to brush up on any aspects of Haskell syntax or other basics, I recommend Haskell Programming from First Principles.

From past experience, understanding strictness, laziness, and evaluation in Haskell can be a sticking point in understanding the data structure content of this course (which is a significant basis for the rest of the topics we'll cover). We'll be covering it in the course itself, but I highly recommend reading my blog post All About Strictness.

Below is the actual content for the course itself. Feel free to read through any of this material in advance of the course as well, though it's less crucial than the material above.

Intro

Goal: get on the same page about basics of Haskell, some terminology we can use, and understand Haskell's evaluation model.

Data structures

Goal: get comfortable with the most common data structures in Haskell.

RIO

Goal: understand monad transformers, how RIO bypasses most of their usages, and other reasons to use RIO in general.

Concurrency

Write concurrent code safely and easily, avoiding data races almost automatically.

Testing

"If it compiles it works" is a lie, don't believe it.

  • hspec (and some gauge benchmarking for fun)

Performance

Deeper understanding of Haskell performance, and how to improve it.

Configuration

Streaming

HTTP

Worked examples

Bonus material