Welcome to Haskell Weekly! Haskell is an advanced, purely functional programming language. This is a weekly summary of what’s going on in its community. You can subscribe to the email newsletter or the Atom feed.
News from the Haskell community
It’s no secret that most people consider Haskell not just a difficult language to learn technically, but an intimidating language. It has undoubted psychological hurdles. People seem to give up on Haskell at a higher rate than most other languages. By naming these problems, we can overcome them.
You need at least two things to produce a random number: an initial “seed” value and a pure function that produces a new number from that seed (“RNG”). That’s all for a single number. Most programming languages will hide these details from you unless you need them.
a ~ bin this declaration is a type equality constraint: it means that
bmust be the same type. One of my coworkers saw this and remarked, more or less, “Why did you write it in that obtuse way? You could have just declared an instance for
C a a, which means the same thing.”
It lets you take a GraphQL schema and translate it into a Haskell type that represents the schema. You can then write handlers that accept and return native Haskell types. graphql-api will take care of parsing and validating your user queries, and Haskell’s type system will make sure that your handlers handle the right thing.
HaskellDO is a Haskell code editor, centered around interactive development.
Back in 2000, Thomas Hallgren showed an implementation of insertion sort as an example of static computation using functional dependencies. In this post, I will show you a more “functional-style” implementation of insertion sort using closed type families.
The first attempt was awful. But it worked! Of course, the API of the library was horrendous. There were very little type guarantees for anything and the whole thing was just one big giant IO blob. Having realized this, I went on a crusade to learn all the fancy type machinery and make use of every trick and extension under the sun.
Package of the week
This week’s package of the week is servant-named, a library that allows you to name endpoints for Servant APIs and servers.
Send us a message on Twitter to nominate next week’s package!