Issue 61 2017-06-29
Subscribe now! We'll never send you spam. You can also follow us on Twitter or with our feed. Read more issues in the archives.
Welcome to another issue of Haskell Weekly! Haskell is a purely functional programming language that focuses on robustness, concision, and correctness. This is a weekly summary of what’s going on in its community.
Haxl: Making concurrency unreasonably easy
Haxl is a big hammer for doing I/O concurrently, testing I/O, and modularity (caching & memoization).
I’m going to give a short introduction to Brick, a Haskell library for building terminal user interfaces. So far I’ve used brick to implement Conway’s Game of Life and a Tetris clone. I’ll explain the basics, walk through an example snake application, and then explain some more complicated scenarios.
Simplexhc: An STG to LLVM compiler
STG’s lowering to C-- and the decisions taken when implementing it were based in the ‘90s. That’s not to say that the GHC team hasn’t done an awesome job keeping it up to date; they have! But, I wonder what a complete rewrite of this lowering would look like. Hence, I’m trying to experiment in this space and see what happens.
Front Row is hiring a senior backend Haskell engineer (ad)
Come change how 6.5+ million K-12 US students learn Math, Language Arts, Social Studies and more. Use data, advanced type systems, great product design and deep pedagogy to change lives.
In this post I want to argue that threads are also a resource, in the sense that they require management after we’ve created them. A stray thread will consume memory, CPU cycles, and really whatever resource it might need to execute.
The value in this approach is that I don’t have to think about what functions to call to collect the images: it’s always
images. In the prior example, I had to think about the how to collect the images each time, and it took brain power better spent elsewhere.
I hope the primary thing you take away from it is a deeper understanding of how monad transformer stacks interact with operations in the base monad, and how monad-control works in general.
RecordWildCardsand binary parsing
RecordWildCardsis a GHC extension that makes working with Haskell records more convenient. The extension has been blogged about in a few places already, so this post intends to provide a different motivating example: binary parsing.
On naming things: Library design
I’ve written a few libraries now and have tried out different naming and exporting conventions. I’ve developed a bit of a feel for how it is to write and use them, and I’m going to put out my personal preferences and opinions on library design here.
Haskell Bits #6: A guide to mutable references
There are quite a few ways to store mutable data in Haskell. Let’s talk about some of them! Specifically, we will focus on mutable containers that store a single value that can be modified by one or more threads at any given time. I’m not going to go into a ton of detail here — I just want to give an overview.
Interfaces and type classes: Number APIs in C# and Haskell
In C# sometimes I sorely miss something like an
INumber<T>interface with methods add, subtract, multiply, and others. The lack of this means it is cumbersome to write generic code on numbers.
Package of the week
This week’s package of the week is data-has, a library that provides a simple extensible product system.