location_city Bengaluru schedule Dec 12th 10:00 AM - 06:00 PM place Board Room 1 people 29 Interested add_circle_outline Notify

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 years ago

Public Feedback


    • Liked Michael Snoyman
      keyboard_arrow_down

      Michael Snoyman - Functional Programming for the Long Haul

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

      How do you decide whether a programming language is worth using or not? By necessity, such decisions are usually based on assessments that can be made relatively quickly: the ease of using the language, how productive you feel in the first week, and so on. Unfortunately, this tells us very little about the costs involved in continuing to maintain a project past that initial phase. And in reality, the vast majority of time spent on most projects is spent in those later phases.

      I'm going to claim, based on my own experience and analysis of language features, that functional programming in general, and Haskell in particular, are well suited for improving this long tail of projects. We need languages and programming techniques that allow broad codebase refactorings, significant requirements changes, improving performance in hotspots of the code, and reduced debug time. I believe Haskell checks these boxes.

    • Liked Aaron W Hsu
      keyboard_arrow_down

      Aaron W Hsu - Does APL Need a Type System?

      45 Mins
      Talk
      Intermediate

      APL is known for its concise problem-solving expressiveness, and it is used very successfully in places where high-quality and rapid iteration are requirements, not luxuries. Static Type Systems have had tremendous success throughout the computing industry, even receiving positive HCI usability studies that demonstrate their effectiveness on a number of metrics with mainstream and functionally-oriented programming languages. This success leads many programmers to take the value of type systems as a given, especially as mission-criticality and the age of a project increase. Therefore, it comes as a surprise to many, when learning about APL, that it has spent so long as an untyped, interpreted language in domains and use cases where traditional wisdom would suggest the need for a typed, compiled language.

      But APL is not like other languages, and its unique features and historical uses warrant a careful revisiting of the question of type systems. In this talk we will explore whether or not APL needs a type system, whether it would benefit from having one, what that might look like, and how the interaction between APL and type theory might inform the design and use of type systems in general.

    • Liked Anne Ogborn
      keyboard_arrow_down

      Anne Ogborn - Declarative Expressions of Behavior

      Anne Ogborn
      Anne Ogborn
      Logic Programmer
      DataChemist.com
      schedule 1 year ago
      Sold Out!
      45 Mins
      Talk
      Beginner

      We write programs in a different language than we talk about them. "So we get a request, do the security mumble, pass it to the middleware that grabs ..."

      Can we get closer to writing programs that describe the program's desired behavior? And why do such attempts always get poo-pooed by programmers?

      This is a foofy cloud shaped drawings exploration of other ways to express software design intent, mostly by cheating.

    • Liked Saurabh Nanda
      keyboard_arrow_down

      Saurabh Nanda - "Refresh-driven" development with Haskell & Elm

      Saurabh Nanda
      Saurabh Nanda
      Founder
      Vacation Labs
      schedule 2 years ago
      Sold Out!
      45 Mins
      Tutorial
      Beginner

      We sorely missed the rapid "refresh-based" feedback loop available in Rails (and other dynamically typed web frameworks), while writing Haskell. Change your code, hit save, and refresh your browser!

      In this talk we will share a few tips on how we finally hit productivity nirvana with ghcid and automated code-gen.

      Best of both worlds -- rock-solid type-safety AND being able to reload code with every change.

    • Liked Raghu Ugare
      keyboard_arrow_down

      Raghu Ugare / Vijay Anant - (Why) Should You know Category Theory ?

      45 Mins
      Talk
      Intermediate

      Category Theory has been found to have a vast field of applications not limited to programming alone.

      In this fun-filled talk (Yes! We promise!) , we want to make the audience fall in love with Math & Category Theory in general, and Haskell in particular.

      We will address questions such as below:

      • What is the mysterious link between the abstract mathematical field of Category Theory and the concrete world of real-world Programming ? And why is it relevant especially in Functional Programming?
      • Most of all, how can You benefit knowing Category Theory ? (Examples in Haskell)

    • Liked Harendra Kumar
      keyboard_arrow_down

      Harendra Kumar - High Performance Haskell

      Harendra Kumar
      Harendra Kumar
      Founder
      Composewell Technologies
      schedule 2 years ago
      Sold Out!
      45 Mins
      Talk
      Intermediate

      Haskell can and does perform as well as C, sometimes even better. However,
      writing high performance software in Haskell is often challenging especially
      because performance is sensitive to strictness, inlining and specialization.
      This talk focuses on how to write high performance code using Haskell. It is
      derived from practical experience writing high performance Haskell libraries. We
      will go over some of the experiences from optimizing the "unicode-transforms"
      library whose performance rivals the best C library for unicode normalization.
      From more recent past, we will go over some learnings from optimizing and
      benchmarking "streamly", a high performance concurrent streaming library. We
      will discuss systematic approach towards performances improvement, pitfalls and
      the tools of the trade.

    • Liked Tony Morris
      keyboard_arrow_down

      Tony Morris - Parametricity, Functional Programming, Types

      Tony Morris
      Tony Morris
      Software Engineer
      Simple Machines
      schedule 2 years ago
      Sold Out!
      45 Mins
      Talk
      Intermediate

      In this talk, we define the principle of functional programming, then go into
      detail about what becomes possible by following this principle. In particular,
      parametricity (Wadler, 1989) and exploiting types in API design are an essential
      property of productive software teams, especially teams composed of volunteers
      as in open-source. This will be demonstrated.

      Some of our most important programming tools are neglected, often argued away
      under a false compromise. Why then, are functional programming and associated
      consequences such as parametricity so casually disregarded? Are they truly so
      unimportant? In this talk, these questions are answered thoroughly and without
      compromise.

      We will define the principle of functional programming, then go into
      detail about common problems to all of software development. We will build the
      case from ground up and finish with detailed practical demonstration of a
      solution to these problems. The audience should expect to walk away with a
      principled understanding and vocabulary of why functional programming and
      associated techniques have become necessary to software development.

    • Liked Michael Ho
      keyboard_arrow_down

      Michael Ho - Making the Switch: How We Transitioned from Java to Haskell

      Michael Ho
      Michael Ho
      Sr. Software Engineer
      SumAll
      schedule 2 years ago
      Sold Out!
      45 Mins
      Case Study
      Intermediate

      In this case study presentation, SumAll's CTO, Todd Sundsted, and Senior Software Engineer, Michael Ho, will discuss the move from Java to Haskell along two parallel paths. First, the business/political story — how SumAll convinced the decision makers, fought the nay-sayers, and generally managed the people impacted by the transition. Second, the technical story — how they actually replaced their Java code with Haskell code. Along the way, they will address their hopes and expectations from transitioning from Java to Haskell, and will conclude with the results they've gained and seen to date.

    • Liked Anupam Jain
      keyboard_arrow_down

      Anupam Jain - Purely Functional User Interfaces that Scale

      45 Mins
      Talk
      Beginner

      A virtual cottage industry has sprung up around Purely functional UI development, with many available libraries that are essentially just variants on two distinct approaches: Functional Reactive Programming (FRP), and some form of functional views like "The Elm Architecture". After having worked extensively with each of them, I have found that none of the approaches scale with program complexity. Either they are too difficult for beginners trying to build a hello world app, or they have unpredictable complexity curves with some simple refactorings becoming unmanageably complex, or they "tackle" the scaling problem by restricting developers to a safe subset of FP which becomes painful for experienced developers who start hitting the complexity ceiling.

      In this talk I give an overview of the current Purely Functional UI Development Landscape, and then present "Concur", a rather unusual UI framework, that I built to address the shortcomings of the existing approaches. In particular, it completely separates monoidal composition in "space" (i.e. on the UI screen), from composition in "time" (i.e. state transitions), which leads to several benefits. It's also a general purpose approach, with Haskell and Purescript implementations available currently, and can be used to build user interfaces for the web or for native platforms.

      The biggest advantage of Concur that has emerged is its consistent UI development experience that scales linearly with program complexity. Simple things are easy, complex things are just as complex as the problem itself, no more. Reusing existing widgets, and refactoring existing code is easy and predictable. This means that Concur is suitable for all levels of experience.

      1. For Learners - Concur provides a consistent set of tools which can be combined in predictable ways to accomplish any level of functionality. Due to its extremely gentle learning curve, Concur is well suited for learners of functional programming (replacing console applications for learners).
      2. For experienced folks - Assuming you are already familiar with functional programming, Concur will provide a satisfying development experience. Concur does not artificially constrain you in any form. You are encouraged to use your FP bag of tricks in predictable ways, and you are never going against the grain. It's a library in spirit, rather than a framework.
    • Liked Debasish Ghosh
      keyboard_arrow_down

      Debasish Ghosh - Managing Effects in Domain Models - The Algebraic Way

      45 Mins
      Talk
      Intermediate

      When we talk about domain models, we talk about entities that interact with each other to accomplish specific domain functionalities. We can model these behaviors using pure functions. Pure functions compose to build larger behaviors out of smaller ones. But unfortunately the real world is not so pure. We need to manage exceptions that may occur as part of the interactions, we may need to write stuff to the underlying repository (that may again fail), we may need to log audit trails and there can be many other instances where the domain behavior does not guarantee any purity whatsoever. The substitution model of functional programming fails under these conditions, which we call side-effects.

      In this session we talk about how to manage such impure scenarios using the power of algebraic effects. We will see how we can achieve function composition even in the presence of effects and keep our model pure and referentially transparent. We will use Scala as the implementation language.

      In discussing effects we will look at some patterns that will ensure a clean separation between the algebra of our interface and the implementation. This has the advantage that we can compose algebras incrementally to build richer functionalities without committing to specific implementations. This is the tagless final approach that offers modularity and extensibility in designing pure and effectful domain models.

    • Liked Mark Hibberd
      keyboard_arrow_down

      Mark Hibberd - Hanging on in Quiet Desperation: Time & Programming

      Mark Hibberd
      Mark Hibberd
      CTO
      Kinesis
      schedule 1 year ago
      Sold Out!
      45 Mins
      Talk
      Intermediate

      Time has a profound impact on the complexity of the systems we build.

      A significant amount of this software complexity comes from either an inability to recall previous states or the inability to understand how a state was arrived at.

      From the foundations of AI, LISP and functional programming [1], to causality in distributed systems [2], to the more grungy practices of immutable infrastructure, or the unreasonable effectiveness of fact-based approaches to large scale data systems; the ability to adequately cope with time, and the change and conflict it inevitably creates, is a common thread to being able to build and reason about these systems.

      This talk looks at the impact of time on system design. We will walk through examples of large-scale systems and their battles with complexity. At the end of the talk, the audience should start to see the common spectre of time and have an appreciation of how understanding time is fundamental to maintaining clarity, correctness and reliability in systems.

      [1] Situations, Actions, and Causal Laws
      John McCarthy
      http://www.dtic.mil/dtic/tr/fulltext/u2/785031.pdf

      [2] Times, Clocks and the Ordering of Events in a Distributed System
      Leslie Lamport
      https://amturing.acm.org/p558-lamport.pdf

    • Liked Jayaram Sankaranarayanan
      keyboard_arrow_down

      Jayaram Sankaranarayanan - YAAeM : Yet Another Attempt To Explain M

      45 Mins
      Talk
      Beginner

      It's another attempt to explain Monads to all those who are curious of this M-word.

      The famous Mars Rover problem is used to demonstrate a solution for it using basic Haskell tools and then introduces Monads and demonstrates a solution using the State Monad.

    • Liked Brian McKenna
      keyboard_arrow_down

      Brian McKenna - Starting Data61 Functional Programming Course

      Brian McKenna
      Brian McKenna
      Functional Programmer
      Atlassian
      schedule 2 years ago
      Sold Out!
      90 Mins
      Workshop
      Beginner

      Following Tony and Alois' Introduction to Haskell syntax and tools, we will work through the first few modules of Data61's Functional Programming Course. These modules cover writing functions for the optional and list data types.

      We will complete enough exercises to cover basic data types, functions and polymorphism. We'll practice the techniques of equational reasoning, parametricity and type/hole driven development. After completing these modules, you should be able to use the techniques to attempt most other exercises in the repository.

      This workshop has the same requirements as Tony's introduction, along with a download of a recent version of the fp-course repository (https://github.com/data61/fp-course).

    • Liked Luka Jacobowitz
      keyboard_arrow_down

      Luka Jacobowitz - Testing in the world of Functional Programming

      45 Mins
      Demonstration
      Intermediate

      Testing is one of the most fundamental aspects of being a software developer. There are several movements and communities based on different methodologies with regards to testing such as TDD, BDD or design by contract. However, in the FP community testing is often not a large topic and is often glossed over. While it’s true that testing in functional programming tends to be less important, there should still be more resources on how to create tests that add actual value.

      This talks aims to provide exactly that, with good examples on how to leverage property based testing, refinement types and the most difficult part: figuring out how to test code that interacts with the outside world.

    • Liked Mark Hibberd
      keyboard_arrow_down

      Mark Hibberd - Property Based Testing

      Mark Hibberd
      Mark Hibberd
      CTO
      Kinesis
      schedule 2 years ago
      Sold Out!
      90 Mins
      Workshop
      Beginner

      Building on the earlier two introductions to functional programming with types, property based testing is the extra verification technique you need to ensure working software. We will work through the patterns of property based testing, starting with simple functions, working up to verification of a larger program.

      By the end of this workshop participants will have a better understanding of the advantages of property based tests over example based tests, as well as acquiring the skills and confidence to start applying property based testing techniques to their current work.

      This workshop has the same requirements as Tony's introduction, and will require a recent clone of the workshop repository available at https://github.com/markhibberd/property-based-testing-workshop.

    • Liked Tony Morris
      keyboard_arrow_down

      Tony Morris - Let's Lens

      Tony Morris
      Tony Morris
      Software Engineer
      Simple Machines
      schedule 1 year ago
      Sold Out!
      480 Mins
      Workshop
      Intermediate

      Let's Lens presents a series of exercises, in a similar format to the Data61 functional programming course material. The subject of the exercises is around the concept of lenses, initially proposed by Foster et al., to solve the view-update problem of relational databases.

      The theories around lenses have been advanced significantly in recent years, resulting in a library, implemented in Haskell, called lens.

      This workshop will take you through the basic definition of the lens data structure and its related structures such as traversals and prisms. Following this we implement some of the low-level lens library, then go on to discuss and solve a practical problem that uses all of these structures.

    • Liked Aaron W Hsu
      keyboard_arrow_down

      Aaron W Hsu / Dhaval Dalal / Morten Kromberg - Array-oriented Functional Programming

      90 Mins
      Workshop
      Beginner

      APL is the original functional programming language, the grand-daddy, the Godfather, and the old workhorse. But don't let Grandpa's age fool you. APL programmers have been leveraging the use of functional programming with arrays long before it was cool to be chasing pointers in an ADT using statically typed pattern matching, and they've refined their own style and approach to getting the most from a "functional paradigm."

      In this workshop, you will have the chance to spend some time thinking like a functional array programmer. What makes it different? How does the code look at the end? What thought process do you go through to get there? Get a chance to play around with some classic problems and try solving them "the APL way."

      Taijiquan Classics say, "Four ounces deflects a thousand pounds."

      APLers might say instead, "Fifty characters solve a thousand problems."

    • Liked Jayaram Sankaranarayanan
      keyboard_arrow_down

      Jayaram Sankaranarayanan - Ring Of Effects Architecture Driven by FP!

      20 Mins
      Experience Report
      Beginner

      This talk shares case study on how an application's design and architecture evolved when functional principles were applied and application was refactored.

      The transformation of the architecture and how developers understood the structure of the application is also discussed.

      It starts with outlining the basic use case, initial implementation tech stack and high level design and how iteratively the design was changed by applying the following FP principles.

      1. No mutable global state

      2. Use pure functions

      3. Effects as Data and Restrict effects to outer ring of the application

    • Liked Debasish Ghosh
      keyboard_arrow_down

      Debasish Ghosh - Power of Functions in a Typed World on the JVM

      90 Mins
      Tutorial
      Beginner

      John Carmac once mentioned on twitter that "Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function." In this talk we will discuss the power of functions in modeling real world applications on the JVM. When we say functions, we mean "pure" functions as in the world of mathematics.

      Functions model behaviors, functions compose to build larger functions, and combined with a powerful type system allow us to abstract over the generalities in defining real world domain models. The combination of functions along with algebraic data types has proven to be extremely useful in designing large scale systems that are modular and extensible.

      Scala is a typed functional (well, almost) language on the JVM. In this session we will discuss how the functional features of Scala offer many of the above benefits in designing large scale systems. If you are coming from an OO background, you will appreciate how an alternative approach to programming can make your systems simpler to design, implement and maintain.

    • Liked Zubin Duggal
      keyboard_arrow_down

      Zubin Duggal - The Future of Haskell Tooling

      20 Mins
      Talk
      Intermediate

      Haskell tooling, particularly editor and IDE integration has been sorely lacking for years. This talk will be a broad overview of the state of Haskell tooling, and the challenges faced by it. It will be derived from the experience of working on two summer of code projects trying to improve Haskell tooling.

      For tooling users, we will discuss different Haskell tools available today(intero, haskell-ide-engine, ghcid etc.), their differences and trade-offs with respect to build tool support(stack, cabal, new-build, nix, make etc.), editor integration, features, limitations and speed.

      We will go over the approach taken by haskell-ide-engine and the Language Server Protocol in order to solve these problems. Then we will discuss the new .hie file format designed to make information about Haskell source collected by GHC more accessible to tooling and users.

      Finally, for budding tooling writers, we will discuss the various approaches to writing programs that extract information from and manipulate Haskell source, and their pros and cons:

      • The GHC API
        • Via ghc-mod and haskell-ide-engine
      • ghc-exactprint
      • haskell-src-extras
      • GHC source plugins
      • .hie files