21 October 2021
Why write a type-checking plugin?
Why would you want to write a type-checking plugin? Many limitations of the GHC type-checker are exposed here.
13 October 2021
Denotational Homomorphic Testing
Property test a denotational model of a data structure.
23 September 2021
Functional data pipelines with funflow2
Introducing a library for writing data pipelines which compose well and fail early
28 July 2021
Convert Cabal-based projects to Bazel automatically
Announcing the gazelle_cabal tool for automatic Bazel rules generation for Cabal projects
8 July 2021
Exploring linear Traversable
What should the type of linear traverse be exactly?
15 June 2021
AsciiDoc in Pandoc and Haskell
Announcing asciidoc-hs, a new AsciiDoc parser and converter in Haskell, adapted for use with Pandoc.
15 April 2021
Arrows, through a different lens
How to use lenses and other optics within an Arrow-based framework.
8 April 2021
Ad-hoc interpreters with capability
Define effect interpreters dynamically using reflection
25 March 2021
Haskell and Java built with Bazel
Discussion on using Bazel with inline-java
10 February 2021
Announcing linear-base, a standard library for linearly typed Haskell programs.
29 January 2021
Intern opening to improve GHC performance
A call to action to improve GHC's performance via a paid internship
7 January 2021
Haskell dark arts, part I: importing hidden values
How to break encapsulation and import a hidden value in Haskell.
25 November 2020
A tale of Template Haskell and cross compilation
Why Template Haskell is hard for cross compilation and how Asterius does it
11 November 2020
Pure destination-passing style in Linear Haskell
Destinations give you control over your memory allocations, and linear types make them pure.
9 October 2020
Edge computing with servant on Cloudflare
Just a few days ago, Cloudflare and Stack builders published a excellent blog post where they demonstrate how to deploy a Haskell program to Cloudflare Worker with Asterius. In this post we go one step further and show that you can deploy full-fledged servant applications just as…
7 October 2020
GHCIDE Fellowship summary
Summary of the Tweag open source fellowship work related to ghcide
30 September 2020
Fully statically linked Haskell binaries with Bazel
Bazel gains support for creating fully statically linked Haskell binaries with rules_haskell and rules_nixpkgs.
13 July 2020
Announcing qualified do
Announcement of the upcoming QualifiedDo language extension.
29 June 2020
Testing splittable PRNGs
How we ensured that the implementation of random v1.2 produces higher quality random numbers than v1.1.
19 June 2020
Linear types are merged in GHC
Looking back at the journey which brought us there, and forward to what still lies ahead.
11 June 2020
Benchmarks of inline-java and a discussion of its performance trade-offs.
6 May 2020
A Bazel for Haskell tutorial
How to build a complete Haskell project with Bazel.
16 April 2020
The three kinds of Haskell exceptions
Imprecise, synchronous, asynchronous exceptions: what do they mean, and what to do with them.
2 April 2020
Eager vs. Lazy Instantiation
This blog post describes the tradeoffs of the choice between eager and lazy instantiation of type variables in GHC.
12 March 2020
Inferred or Specified Types? Your Choice!
During my internship, I implemented the explicit specificity proposal to make GHC type signatures complete.
5 March 2020
Code is Engineering, Types are Science
Peirce divides reasoning into three complementary processes: deduction, abduction and induction. In this post, I will show how these logical processes relate to software.
26 February 2020
Probabilistic Programming with monad‑bayes (3)
In this blog post series, we're going to lead you through Bayesian modeling in Haskell with the monad-bayes library. In the third part of the series, we setup a simple Bayesian neural network.
19 February 2020
On linear types and exceptions
A primer on the interaction between linear types and exceptions in Haskell.
6 February 2020
A safer inline-java
In this post about inline-java I aim to walk you through the upcoming safe interface of the library, which allows detecting memory management mistakes at compile time using linear types.
30 January 2020
Profiling Large Haskell Codebases
This post describes a profiling technique for Haskell codebases that yields faithful results and is well adapted to large repositories.
16 January 2020
A Tale of Two Functors
Haskell's Data and Control module hierarchies have always bugged me. Now, I understand that the intuition behind the Data/Control separation is rooted in a deep technical justification.
19 December 2019
Art in browser with Asterius
Asterius compiles Haskell code into WebAssembly code to be executed in a browser or in Node.js. It has reached a new milestone by being able to compile the diagrams library and its dependencies.
8 November 2019
Probabilistic Programming with monad‑bayes (2)
Here's Part 2 in Tweag's Series about Bayesian modeling in Haskell with the monad-bayes library.
30 October 2019
Porcupine: Announcing First Release
We're happy to announce the first release of Porcupine, an open source framework to express portable and customizable data pipelines.
11 October 2019
Ormolu: Announcing First Release
We're happy to announce the first release of Ormolu, a formatter for Haskell source code.
9 October 2019
Third-party Haskell libraries in Bazel
Bazel gets native support for third-party Haskell libraries and building Cabal packages since the 0.10 release of rules_haskell.
25 September 2019
Bazel's Persistent Worker Mode for GHC
I got the opportunity to work on Bazel's Persistent Worker Mode for GHC during my internship at Tweag. My goal was to improve the mode of communication between Bazel and the Haskell GHC compiler.
20 September 2019
Probabilistic Programming with monad‑bayes (1)
In this blog post series, we're going to lead you through Bayesian modeling in Haskell with the monad-bayes library. In the first part of the series, we introduce two fundamental concepts of `monad-bayes`: `sampling` and `scoring`.
12 September 2019
War Stories of Asterius
I got the opportunity to work on Asterius, a new Haskell to WebAssembly compiler, during my internship at Tweag. My task was to get anything numerics-related stabilized in its compiled code.
6 September 2019
Why Haskell is important
People keep asking me, “What's the point of Haskell, why do you folks even use it?”. How can you answer this?
27 June 2019
CPP considered harmful
Edsger Dijkstra took issue with the “unbridled” use of the programming construct in 1968. He noted that our already limited ability to reason about the dynamic behaviour of imperative programs was nigh impossible in the presence of -jumps to arbitrary labels. With , control flow…
27 May 2019
Ormolu: a new Haskell formatter
If we think of the average Haskeller, who do we see? A poor, broken person. Tired head falls into the open palms, sobbing, deprived of the basic human right for automated source code formatting. Is it at all conceivable that so many attempts were made and none quite succeeded…
9 May 2019
Tweag.io has a bit of a history with language interop. By this point, we created or collaborated with others in the community on HaskellR, inline-c, inline-java, and now inline-js. The original idea for this style of interop was realized in language-c-inline by Manuel Chakravarty…
20 March 2019
Capability is about free monads
There has been recent online discussions about impredicative encoding (aka final encoding) of free monads. Capabilities-as-type-classes, as embodied by the capability library, are essentially the same thing.
13 February 2019
The types got you
Haskell is in a way a unique language. It is, to be clear, a language people and businesses use for building “serious stuff”, yet it is also a language which remains a platform for experimentation with functional programming. This means that the teams which develop in Haskell…
23 January 2019
Harnessing the Power of Haskell in JupyterLab
Introduction Haskell and data science - on first sight a great match: native function composition, lazy evaluation, fast execution times, and lots of code checks. These sound like ingredients for scalable, production-ready data transformation pipelines. What is missing then? Why…
20 December 2018
TodoMVC in Haskell via WebAssembly
Getting your browser to print “Hello World!” is fun, and a milestone for compiler writers targeting the web. Soon expectations change. Can you call existing code? Can you write a moderately complex web app? How fast does it run? Previously, we showed how Haskell can call…
4 October 2018
About a year ago, Michael Snoyman made a blog post about the ReaderT pattern. Ostensibly, it’s a blog post about preferring to encode state as -s when you can. But that’s not how we read it. What we saw first and foremost is a story about using extensional type classes describing…
12 September 2018
10 July 2018
Funflow Example: emulating Make
Funflow is a workflow management tool. It turns out that workflow management tools and build tools are closely related. So if you’re more familiar with the latter, this post might be of interest to you. We’ll be illustrating some of Funflow’s features by implementing Make on top…
21 June 2018
Streaming with linear types
In an earlier blog post, we discussed how streaming libraries help writing composable programs without lazy I/O. We showed, for a simple program, how using a streaming library helps reducing the amount of unaided bookkeeping that the programmer needs to do in order to make it…
29 May 2018
Compiling Haskell to WebAssembly
Asterius is an experimental WebAssembly backend for GHC. We aim to support most GHC features while making the emitted WebAssembly code as small and fast as possible. The project recently reached an exciting milestone: for the first time, simple Haskell functions can be compiled…
25 April 2018
Funflow is a system for building and running workflows. It’s a system we’ve been working on for the last few months with a small number of clients. In this blog post we’ll talk about what workflows are, why we built Funflow, and what we’d like to do with it in the future. What is…
17 April 2018
Stackage HEAD is now live!
We are happy to announce that Stackage HEAD is now functional. For those who had missed the original blog post, or already forgot it, let’s refresh the idea behind Stackage HEAD. Each Stackage Nightly is a build plan that includes a large set of real-world packages that are known…
8 March 2018
Implementing a safer sort with linear types
In the “all about reflection” post, we introduced the data type. Any sorting function should have the type . However, this doesn’t actually guarantee that is indeed a sorting function: it only says that is a sorted list, but not that it is actually a sort of . For example is…
28 February 2018
Bazel now supports building Haskell
Publishing code to the world is easy these days: take your code, tack some extra metadata onto it, call that a package and upload it to npmjs.com / crates.io / Hackage / etc. It’s also easy for other developers to include your code as part of their project: build tools are…
5 February 2018
Free monads for cheap interpreters
The utility of free monads can show up in surprising places. One of the projects I’m working on is an AI, and part of the strategy that it uses for responding to user input is quite simple: it generates many possible responses, and then evaluates them. Most of the computations it…
21 December 2017
All about reflection
An important device in the tool belt I carry around everyday is type class reflection. I don’t reach for it often, but it can be very useful. Reflection is a little known device. And for some reason it is often spoken of with a hint of fear. In this post, I want to convince you…
29 November 2017
Making two garbage collectors be good neighbours
Foreign function interfaces (FFI) allow fast interop between languages. Unlike other approaches, like performing RPC calls between different components written in different languages, using the FFI allows for all manner of data to be shared between each language runtime, in the…
16 November 2017
Parallelising your array code
This is the fifth post in a series about array programming in Haskell — you might be interested in the first, second, third, and fourth, too. A recurring theme in array programming is performance. After all, many algorithms in numerical computing and data science are…
1 November 2017
The Exodus to Streamgard, an epic poem
If Haskell was a god, often would he be depicted with the ravens Modularity and Abstraction flying above him, hovering the world and reporting to him every detail of our whereabouts. Haskell would sit on the Throne of Purity and look upon the world with an eye full of wisdom. And…
27 October 2017
Using Stackage for GHC regression testing
A recent development in Haskell land is the formation of the GHC DevOps Group, which was the topic of last week’s blog post. The group is a community of parties committed to the future of GHC. Tweag I/O is one such party. We are helping the group achieve its goals with concrete…
19 October 2017
Announcing the GHC DevOps Group
As Haskell is increasingly used in production environments, the Haskell toolchain is of critical importance to a growing number of people and organisations. At the heart of this toolchain is GHC (The Glasgow Haskell Compiler). Conceived nearly thirty years ago as a research…
12 October 2017
Array fusion with vector
This is the fourth post in a series about array programming in Haskell — you might be interested in the first, second, and third, too. In the previous post of this series, we explored the basic, down-to-earth, index-based array interfaces that have their roots in the Haskell…
5 October 2017
How to compose streaming programs
In our first blog post about streaming, we discussed how streaming libraries strengthen types to catch more errors. However, when we strengthen types, we need to be careful to not hinder program composition. After all, precise type information can make it more onerous to convince…
27 September 2017
Immutability and unboxing in array programming
This is the third post in a series about array programming in Haskell — you might be interested in the first and second, too. In the previous post of this series, we discussed commonly used vector and matrix routines, which are available in highly-optimised implementations in…
22 September 2017
GHC compiler plugins in the wild: typing Java
Previously, we discussed how to use inline-java to call any Java function from Haskell. The reverse is also possible, though that will be a topic for a future post. In this post, we’ll peek underneath the hood to talk a little about how inline-java does its deed. You might find…
15 September 2017
Java from Haskell: a tutorial
Our introductory post for inline-java showed that we could call methods written in Java (or indeed any JVM function) from Haskell. Much in the style of other packages, it is moreover possible to do using java syntax, so examples from Java API documentation can be reused as-is. In…
31 August 2017
Enter the matrix, Haskell style
This is the second post in a series about array programming in Haskell — you might be interested in the previous post, too. Matrices are the bread and butter of most scientific and numeric computing. It is not surprising then that there is a range of standard libraries and…
24 August 2017
Compact normal forms + linear types
We saw last time that with linear types, we could precisely capture the state of sockets in their types. In this post, I want to use the same idea of tracking states in types, but applied to a more unusual example from our paper: sending rich structured data types across the…
17 August 2017
Diversity through inline code
Haskell is an awesome language, but we need to remember that it is not very useful in isolation. In almost any realistic application, Haskell has to coexist with other languages, even if only to call existing C libraries or to make use of operating system services. In actual…
9 August 2017
Array programming in Haskell
Array programming in Haskell is attractive, but it is also somewhat confusing. Haskell’s functional syntax is close to the mathematical notation that is often used to develop and explain the algorithms on which array programs are based, which leads to great clarity of expression…
3 August 2017
Encode state transitions in types using linear types
At the time of our first post on linear types, we were fresh out of the design phase to extend GHC with linear types. We had a prototype implementation, but it was just a proof of concept: there was precious little you could do with it. A few months down the line, we are now in a…
27 July 2017
Streaming programs without laziness
In school, we’re taught that I/O is a simple affair: read data in, write data out. Rinse, repeat. But then as practitioners we realize matters are often more complicated. For one, I/O is slow, so we probably want operations to overlap (i.e. be processed asynchronously…
10 July 2017
R and Haskell: best of both worlds with HaskellR
A guest post by Sigrid Keydana telling us the backstory behind the very cool trading app notebook she put together… Keras, ggplot2, Haskell and R all in one Jupyter notebook! Post originally appeared here. Earlier today, I presented at UseR! 2017 about HaskellR: a great piece of…
13 March 2017
Linear types make performance more predictable
We’re extending GHC with linear types. Ever since Jean-Yves Girard discovered linear logic in 1986, researchers around the world have been going “wow! resource tracking, this must be useful for programming languages”. After all, any real computation on a real machine takes…
17 October 2016
A new ecosystem for Haskell: the JVM
20 June 2016
Haskell compute PaaS with sparkle
Maintaining a compute cluster for batch or stream data processing is hard work. Connecting it up to storage facilities and time sharing resources across multiple demands even more so. Fortunately cloud service providers these days typically upscale their offering to not just…
25 February 2016
Haskell meets large scale distributed analytics
Large scale distributed applications are complex: there are effects at scale that matter far more than when your application is basked in the warmth of a single machine. Messages between any two processes may or may not make it to their final destination. If reading from a memory…
9 December 2015
Stack + Nix = portable reproducible builds
Stack and Cabal are great tools for incremental development. But before even starting to think about what your first commit will be about on a freshly checked out project, what you have to do is get a working development environment, by which we mean: see if it builds! Stack…
8 September 2015
Programming R at native speed using Haskell
Most good data stories start with a interesting question. If the average request latency went down by a further 100ms, by how much could we expect user engagement to increase? How can we detect evidence of corruption of government officials given a list of all bids nationwide for…