T2: Light-weight and type-safe scripting with Haskell

  • Gabriel Gonzalez Twitter
September 03, 2015 9:00 AM - 12:30 PM


The shell is a nearly universal API used to assemble components written in multiple programming languages. However, shell scripts are the weakest link in any software architecture because they are weakly typed (everything is a string) and dynamically typed (no static assurances). You can only detect errors by running the script and even a dry run will not detect all the byzantine ways that string-based operations can fail. Shell scripts can also fail catastrophically since they run with elevated privileges necessary to control each component that they glue together.

This tutorial walks through using Haskell as a scripting language for higher static assurances of correctness. Haskell scripts are strongly typed and statically typed, yet syntactically light-weight: they are not much longer than the equivalent shell scripts. You will also learn introductory Haskell concepts along the way.

Infrastructure required: ghc and cabal

Tutorial objectives

Learn to use Haskell as a type-safe scripting language

Target audience

Site reliability engineers and software engineers with no prior Haskell experience.

Gabriel Gonzalez

Gabriel Gonzalez

Gabriel Gonzalez is a software engineer at Twitter who programs in Scala by day and Haskell by night. He'll talk your ear off about functional programming if you give him the chance.