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:
-
Download and install Stack. Instructions are available online. Make sure you have at least version 1.9.
-
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.
- You may also find it convenient to run
-
Make sure you can run the script below successfully. Save it to a file ending with
.hs
and then runstack filename.hs
. On non-Windows systems, you can also dochmod +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
Links
All of my previous talks are linked to from my homepage: https://www.snoyman.com/
schedule Submitted 4 years ago
People who liked this proposal, also liked:
-
keyboard_arrow_down
Naresh Jain / Aaron Hsu / Andrea Leopardi / Bruce Tate / Edward Kmett / Saurabh Nanda - Q & A Session With Functional Conf Speakers
Naresh JainFounderConfEngineAaron HsuComputer ResearcherDyalog Ltd.Andrea LeopardiCore Team MemberElixir LangBruce TateFounderGroxioEdward KmettResearch EngineerMachine Intelligence Research InstituteSaurabh NandaFounderVacation Labsschedule 4 years ago
45 Mins
Keynote
Beginner
During the conference you might have had questions that did not get answered, this is your opportunity to get them answered by our expert panel group
-
keyboard_arrow_down
Naresh Jain / Andrea Leopardi / Bruce Tate / Mohammad Maqbool Alam / Nikhil More / Ravi Chandra Padmala / Sujatha Hemmady - Q & A Panel Discussion with Code Beam Lite India Speakers
Naresh JainFounderConfEngineAndrea LeopardiCore Team MemberElixir LangBruce TateFounderGroxioMohammad Maqbool AlamSoftware DeveloperUnderjord ABNikhil MoreSr. EngineerVolansysRavi Chandra PadmalaPartnernilensoSujatha HemmadyTech LeadRedbusschedule 4 years ago
45 Mins
Talk
Beginner
During the Code Beam Lite conference you might have had questions that did not get answered, this is your opportunity to get them answered by our expert panel group
-
keyboard_arrow_down
Michael Snoyman - Your first Haskell web app with WAI and Warp
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.
-
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.
-
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").
-
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.
-
keyboard_arrow_down
Sujatha Hemmady - My journey with Erlang at Redbus
45 Mins
Talk
Beginner
Going from Java to Erlang is not hard if given proper support. This talk is about the roller coaster journey with Erlang to build a scalable, soft real-time transaction platform. If you are a Java developer struggling to understand and adapt to Erlang this talk is for you.
-
keyboard_arrow_down
Tamizhvendan S / Ravindra Jaju - JVM Language Interoperability
Tamizhvendan SLead ConsultantAjiraRavindra JajuSolutions ConsultantSahaj Softwareschedule 4 years ago
45 Mins
Demonstration
Beginner
Language interoperability is the capability of two different programming languages to natively interact as part of the same system. Interoperability is advantageous because different programming languages are optimized for specific tasks, and allowing them to communicate can create better systems.
Apart from the Java language, the most common or well-known JVM languages are:
- Scala, a statically-typed object-oriented and functional programming language
- Clojure, a modern, dynamic, and functional dialect of the Lisp programming language
- Kotlin, a statically-typed language
In this session, we'll demonstrate how your program can interop with different JVM languages.
-
keyboard_arrow_down
Anmol Sahoo - GADTs in OCaml
90 Mins
Tutorial
Intermediate
OCaml is a multi-paradigm programming language with a pragmatic mix of functional and imperative programming features. OCaml, which has been around since 1996, has grown to be a battle tested language, widely deployed and used in production systems. In this talk, we will look at the support for Generalized Algebraic Data Types (GADTs), a powerful generalization of the more mundane Algebraic Data Types (ADTs). We will start with an example of building an interpreter for a small language and add type safety through GADTs. We will then look at a few powerful type-safe design patterns that GADTs enable.
-
keyboard_arrow_down
Dhaval Dalal - Booting into FP
90 Mins
Tutorial
Beginner
This session is an whirlwind tour of the FP land and is primarily meant for developers wanting to embark on their functional programming journey. We will use Java to understand most of the concepts, however, where it falls short to explain certain concepts, we will use Scala or Groovy or Clojure or even Haskell to demonstrate it. Starting with the basics - introducing the concepts with examples, we will evolve our understanding to take the mystery out of the monads (hopefully!)