lablog

Haskell

Writing a generic XML pickler Erik

5 comments

In a previous post, Sebas explained that we use so-called XML picklers to convert Haskell data types to XML. Since these picklers have a regular structure, we don’t write them by hand, but derive them automatically using generic programming techniques. In this post, I’ll explain how our generic XML pickler works. The code shown here has been made available on hackage.
Continue reading…

Haskell data types and XML Sebas

7 comments

Here at typLAB it wasn’t evident from the beginning what would be the best choice for a storage back-end. We knew that we were about to build a web based editor and would be dealing with a lot of HTML5 documents with lots of meta data. After some careful consideration we decided to go for an XML database. More specifically, the Berkeley XML Database, lovingly called DBXML by its authors.

We figured that using DBXML would give us some important advantages:

Once we decided to go for an DBXML back-end we had to figure out how to easily get values form our Haskell program in and out of the database. The rest of this post will be dealing with the last point of our enumeration: how to get a nice mapping from Haskell’s algebraic datatypes to our DBXML back-end.

Continue reading…

Why we use Haskell Erik

9 comments

As a newly started company, we have a lot of technical decisions to make. One of the important ones is the choice of a programming language. Since we’re building a web application, this goes for both the client (i.e. the web browser) and the server.

On the client, there wasn’t much discussion. Javascript is the only viable choice, unless you want to use Flash or similar plugin-based models. But on the server, we had more freedom. Popular choices for web applications are dynamically typed languages like Ruby, Python and PHP, and statically typed languages like Java and C#.

However, there was another option. Two of us (me and Sebas) are enrolled in the Software Technology master program at Utrecht University, where we often use the programming language Haskell. Haskell is a functional programming language, which means that a program is composed of expressions instead of statements, as is the case in an imperative programming language.

As you might have guessed from the title of this post, we decided to use Haskell for our server side programming. What are the features that made us choose Haskell?
Continue reading…