Welcome to another issue of Haskell Weekly! Haskell is a safe, purely functional programming language with a fast, concurrent runtime. This is a weekly summary of what’s going on in its community.
I am using some GHC pragmas to optimize Alga and I must admit that they are very powerful. On the wise counsel of one of my GSoC mentors, A. Mokhov, here is a little summary of what I discovered, as this can help others.
I’m happy to announce that you can now easily load GHC into GHCi! I’ve been using this for about a month now, and for me it makes GHC development far more pleasant than using make. This can often lead to iteration times of only 10-30 seconds to try out some modified behavior.
If you haven’t heard of them before, HAMTs are a way of efficiently representing a hashtable as a trie, and although they were first envisioned as a mutable data structure they are easily adapted to work as a persistent data structure.
The lay interpretation is that monads are mathemagical constructs that allow you to add “computations” (also sometimes called “effects”) to a “pure” programming language. This lay interpretation is largely wrong and the Haskell monadic dogma is rather overblown.
If we want to minimise memory usage, the first thing you should do is avoid duplicating data. All the data we want to access is already in the document. Copying that data into intermediate objects so that we can work with them is wasteful.
This blog post compares several implementations of a concrete and relatively simple abstract data type in terms of execution time. Ultimately, we develop an imperative data structure using native Haskell code that is as fast as its C equivalent.
Given a fixed set of proofs, it is natural to consider a lemma to be good to the extent it enables compression of the proofs. But how might we know if a lemma is good before we know how it will be used?
Since I seem to be a one-trick pony, I decided to write yet again to compare streaming data in Haskell and Rust. This was inspired by a cool post I saw on Reddit about converting characters in the Latin alphabet into look-alikes in the Cyrilic alphabet.
I lost count of how many times I’ve seen types/functions/families and another first-class abstractions that shouldn’t exist if we want to use more universal constructions. A little bit of theory can reduce and beautify our production code, and now I will try to demonstrate that.
I’ve been writing a lot of Agda recently, and had the occasion to write a Fenwick tree that did some rebalancing. I went with AVL-style rebalancing (rather than red-black or trees of bounded balance).
Are you looking to hire a Haskell developer? You should advertise with us! Haskell Weekly reaches a highly engaged audience of almost 3,000 functional programming enthusiasts.
As a full-stack engineer at Lumi, you will be an important part of our small and dynamic team, working on a wide variety of projects, from customer-facing features to internal tools. We strive to write elegant code to solve real-world problems.
- Beam: Database power without Template Haskell
- HExplore: A more powerful way to search for packages on Hackage
- How to use Haskell to generate a blog in an unnecessarily convoluted way
- Monthly Hask Anything: August 2018
- Pantry, part 3: Specifying dependencies
- Suggesting valid hole fits for typed-holes
Package of the week
This week’s package of the week is Foundation, an alternative prelude with batteries included and no dependencies.
Call for participation
We are considering removing this section. If you are interested in maintaining this section, or simply don’t want to see it go, please let us know on GitHub!
- August 2 in Singapore: August Haskell meetup
- August 4 in Boston, Massachusetts: Hang out, chat FP, work on some code
- August 6 in Melbourne, Australia: Elm hack night
- August 7 in Singapore: Building GraphQL APIs with Hasura
- August 8 in Boulder, Colorado: Bound for greatness
- August 9 in Hamburg, Germany: Lambda Pi’s initial meetup