Category Archives: Haskell

Code folding in Emacs

Code folding is a feature I’ve taken for granted in Windows IDEs, but now I am using Emacs more and more, I wanted it there too, and it turns out getting it is straightforward enough. Download Folding Mode and save … Continue reading

Posted in Emacs, Haskell, Linux, Ocaml | 5 Comments

Scope in database code (2)

Following on from a previous post, here is some simple database code in hopefully idiomatic Haskell. My strategy is Use the Reader monad to pass the database connection around the functions that use it. The description, computations which read values … Continue reading

Posted in Haskell, SQLite | 7 Comments

Scope in database code

When dealing with relational databases, there are three major types of data structure/objects that we need. The actual names vary between platform and API, but generally there will be, in order of creation: A connection. This is often called lda … Continue reading

Posted in Haskell, Ocaml, Oracle, SQLite | 4 Comments

The List Monad in Python terms

Understanding Monads Via Python List Comprehensions

Posted in Haskell, Python | Leave a comment

Analyzing logfiles (2)

Following on from yesterday’s post, here is a similar tool implemented in Haskell. This one is to process a log format we use for various applications, which is <timestamp>: key1=value1 key2=value2 … keyn=valuen There may be any number of keys, … Continue reading

Posted in Haskell, Ocaml, SQLite | 3 Comments

The State Monad in Python terms

Consider a function like sin. It is a “pure” function, which is to say that it is referentially transparent – every time you call sin(pi) it will return the same value. You could in fact in C say #define sin(pi) … Continue reading

Posted in Haskell, Python | 5 Comments

Compiling Haskell for different Linux distros

One of my goals with this project is to produce code that can run with no external dependencies across as much of our Unix estate as possible. That is several thousand machines, tho’ I am only interested in a few … Continue reading

Posted in Haskell, Linux | 1 Comment

Hello world!

I am (mainly) a DBA, tho’ I also dabble in other bits of back-end infrastructure (operating systems, storage and so on), and one of my key metrics is the ratio of DBAs:DBs in an organization. To that end I am … Continue reading

Posted in Haskell, Ocaml, Python | 5 Comments