Applied Haskell Workshop

This full day workshop will focus on applying Haskell to normal, everyday programming. We'll be focusing on getting comfortable with common tasks, libraries, and paradigms, including:

  • Understanding strictness, laziness, and evaluation
  • Data structures
  • Structuring applications
  • Concurrency and mutability
  • Library recommendations

By the end of the workshop, you should feel confident in working on production Haskell codebases. While we obviously cannot cover all topics in Haskell in one day, the goal is to empower attendees with sufficient knowledge to continue developing their Haskell skillset through writing real applications.

 
 

Outline/Structure of the Workshop

  • Tooling intro
  • Strictness/laziness/evaluation
  • Data structures
    • String types
    • Containers
    • Vector
  • Concurrency
    • Mutable variables
    • STM
    • async

If there is additional time, we can also cover, at the attendees' preference:

  • Exceptions
  • Streaming data
  • HTTP client/server
  • rio

Learning Outcome

The ability to write real world, professional Haskell code.

Target Audience

Attendees who are comfortable with the basics of Haskell, and want to learn how to apply what they already know to real-life projects.

Prerequisites for Attendees

This session will not teach you the basics of Haskell. Instead, we will be starting from the assumption of:

  • Comfort with basic Haskell syntax
  • Understanding of ADTs and pattern matching
  • Understanding of functions, lambdas, partial function application, and currying
  • Understanding of basic Haskell typeclasses, including: Functor, Applicative, Monad, Monoid, Foldable, and Traversable

The recommended approach for learning these topics is Haskell Programming from First Principles.

To prepare for the workshop, please ensure you have Stack and GHC set up on your machine:

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

  2. We're going to be using LTS 12.21. You may as well install an unnecessarily broad number of packages right off the bat: stack build --resolver lts-12.21 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-12.21 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-12.21 script
main = putStrLn "Hello World!"

It's worth reviewing the prereading checklist from my Applied Haskell course, available at:

https://github.com/fpco/applied-haskell#pre-reading

schedule Submitted 2 weeks ago

Public Feedback

comment Suggest improvements to the Speaker

  • Liked Michael Snoyman
    keyboard_arrow_down

    Michael Snoyman - Your first Haskell web app with WAI and Warp

    Michael Snoyman
    Michael Snoyman
    VP, Engineering
    FP Complete
    schedule 2 weeks ago
    Sold Out!
    45 Mins
    Tutorial
    Beginner

    Haskell's Web Application Interface (WAI- pronounced "why") provides an abstraction between web applications and web servers. This allows many different web frameworks (e.g., Yesod, Spock, and Servant) to share servers like Warp and middlewares.

    Haskell's web frameworks offer a wide variety of feature sets, type-level and metaprogramming, and intended use cases. And for most use cases, I would recommend using an existing web framework, which will help you avoid common pitfalls and more quickly address common use cases.

    But not today! In this tutorial, we're going to step through building a functioning web server using just the bare-bones WAI interface and Warp as a server. Familiarity with the basics of Haskell will be a plus, but this will be a talk open to all FP and Haskell skill levels.

  • Liked Tony Morris
    keyboard_arrow_down

    Tony Morris - An Intuition for List Folds

    45 Mins
    Talk
    Beginner

    In this talk, we go back to first principles, defining and examining the definition for a cons list, then take a look at the ubiquitous right and left fold functions on a list.

    The primary focus of this talk is to develop an intuition for how these functions work so that we can best decide when to apply them. Multiple programming languages will be used to help emphasise the independence of the gained intuition. This talk will generally be interactive with the audience as we solve problems and build confidence in our new knowledge.

    Knowing how to apply the various list fold functions is a common question by the student of FP. This talk aims to provide a solid, reliable answer to this question. No prior understanding of list folds is necessary.

  • Liked Tony Morris
    keyboard_arrow_down

    Tony Morris - Zippers

    45 Mins
    Talk
    Intermediate

    The term zipper is a colloquial used to describe n-hole (most often, 1-hole) contexts. That is, a data structure that has a _hole_ or _pointer_ focused on a specific element with the ability to efficiently traverse to its neighbouring elements, providing an elegant solution for the need to efficiently traverse and _modify_ immutable data structures.

    In this talk, we will look at examples of zippers for canonical data structures such as lists and other products and sums. We will then define comonads and see the relationship between zippers and comonads.

    Most of this talk will be spent on the practical application of zippers in everyday programming. We will solve some simple problems using zippers. We will then contrast why we might use a zipper, compared to a lens.

    Finally, for a fun and interesting observation, we will look at the algebraic structure of products and sums, then compute the derivative of these structures. Turns out, a derivative of a data structure is its zipper ("McBride, Conor, et al (2005). ∂ for Data: Differentiating Data Structures").

  • Liked Tony Morris
    keyboard_arrow_down

    Tony Morris - Introduction to Functional Programming using Haskell

    480 Mins
    Workshop
    Beginner

    We will be spending the day learning the fundamentals of Functional Programming (FP) using the Haskell programming language. The exercise material will be a condensed selection of the NICTA/course which is regularly held in Australia over three days.

    This one day session is targeted to experienced industry programmers who are looking to break into Functional Programming and develop the rudimentary skills and techniques that enable continued independent study. A refresher on Haskell syntax will be provided, however, it is highly recommended to practice with the syntax and development tools prior to obtain the best outcome for the day.

    You will be required to bring a suitable development machine (portable) for working through the exercises. You will also need to install Glasgow Haskell Compiler (http://www.haskell.org/ghc/) version 7.8 or higher on that machine prior to the day.