Tagged: haskell

Announcement: Updated Esqueleto text-search & PostGIS bindings []

I’ve updated the esqueleto bindings for esqueleto-textsearch to include a tutorial and documentation so it no longer requires guesswork. Furthermore I’ve also created new esqueleto bindings for PostGIS.

esqueleto

Esqueleto is a more advanced query library that builds on top of the persistent ORM3. Postgres text search brings …

BONUS Announcement mysql pure unfork []

Good news! I’ve come to an agreement with the maintainer of mysql-haskell, winterland. I’ll become a co-maintainer.

What this means in practice is that I’ll deprecate mysql-pure and merge the changes back into mysql-haskell. This will make upgrades far more convenient for users. That’s you! It …

Announcing mysql pure fork []

I’ve forked mysql-haskell and persistent-mysql-haskell into mysql-pure and persistent-mysql-pure. The original packages were no longer maintained and frequently caused me issues during GHC upgrades, so I decided to take over maintainership. For example, bounds were outdated, or I needed minor patches found on obscure branches in unrelated repositories. I …

MySQL Persistent Support for Haskell on Windows []

Using Haskell on Windows can be very useful in a WAMP like situation, where the main legacy codebase is stuck at PHP 5.61 . However, any new pages can be written with Haskell, which is much easier to upgrade since the compiler will inform you about most changes. New …

Failing in Haskell []

I'm a Haskell failure, don't tell anyone!

Recently I encountered some dubious error handling code. Not only was it failing, it was failing WRONG 1. This frustrates me because doing failing correctly in Haskell is quite easy, so why was it implemented wrongly? I believe no-one has addressed failing with an opinion. Plenty of people describe the …

A brief intro to MTL []

mtl-header

Recently a blog post came out which I quite like, it describes how to use the concrete base transformers. It’s very thorough and gives a concrete example for using transformers. Although it looks quite low level and I think you’ll get more out of transformers by using full …

Ghcid for multi package projects []

GHCID magic

When I tried Ghcidfor a reflex project, it wouldn’t rebuild on file change. This is because reflex has a multi package project setup by default. Recently I found that it is possible to use Ghcid for multi package project builds. The trick is to create an executable that …

Reflex server side html rendering []

Reflex is a single page app framework written in Haskell compiled to JavaScript. A major concern with reflex is the slow loading times, this can be mediated however by doing server side rendering1. This blog post will discuss how to do that2.

Bob doing SSR

The main idea is that we …

Authentication in Reflex & Servant []

In the previous blog post we saw interaction with servant in reflex. Although that covers the basics, there are several more hurdles to overcome to get comfortable with Reflex. I think most of these are encountered by building a simple login system. So let’s build something like:

                       +------------------+
   +-----------+       |    .      -      |
   | +--------+|       | .    -  .. .     |
   | +--------+|       | . .-- - + m..-.  |
   | +--------+|    \  |   m …

Lens into wrapped newtypes []

Categorical representation of the <abbr>NT</abbr> iso

All newtypes are isomorphisms


— My mother

Control.Lens.Wrapped uses the isomorphism property to introduce a type class Wrapped. Let’s explore use cases, because after all, it doesn’t appear to do much at first glance. What’s the point of formalizing wrapping and unwrapping of types?

Instance boilerplate …

Fullstack Haskell: Reflex and Servant []

In the pragmatic haskell series, we saw how to setup a simple webserver with database. But at some point you still need a frontend. If it were 2005 you may have been able to get away with just blaze. But we are in 2018+, and JavaScript is a problem. In …

Pragmatic Haskell III: Beam Postgres DB []

Note, I no longer recommend using beam for business as ORM. Please use persistent instead. Beam is far to complicated for it’s use case. Migrations can be run with postgresql-migration for example, using the suggested migrations from persistent. I’d only recommend using beam for hobby projects or as …

Pragmatic Haskell II: IO Webservant []

  1. Pragmatic Haskell: Simple servant web server
  2. Pragmatic Haskell II: IO Webservant
  3. Pragmatic Haskell III: Beam Postgres DB

Most Haskell language guides will leave IOuntillater. This guide is different, this guide is about using Haskell. Our focus is different: We build first, then learn trough delight.

Fancy intro image

The previous blog …

Pragmatic Haskell: Simple servant web server []

  1. Pragmatic Haskell: Simple servant web server
  2. Pragmatic Haskell II: IO Webservant
  3. Pragmatic Haskell III: Beam Postgres DB

There are many guides available for learning Haskell. Setting up a something simple like a web server isn’t so straight forward. Perhaps choosing one of the 14 libraries is a bit much …

Fun with stack: Haskell dependency management []

Haskel stack logo

Working at Daisee, Jappie uses a lot of Haskell programming. Although Haskell is obviously as amazing as the stereotype asserts, the tooling can be a bit challenging. In this blogpost we explore these challenges.

One’s understanding start with the fact that there is not one unified Haskell package manager …