Monthly Archives: September 2010

Database types in OCaml and Python

Consider the following Oracle table: Note that both the values inserted were identical. In Python: Same results in SQL and Python. But in OCaml: What happened there? Well, OCaml is seeing the first column as “1.” and the second as … Continue reading

Posted in Ocaml, Oracle, Python | Leave a comment

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

Dictionary format strings

There is quite a nice feature of Python that allows dictionaries to be applied to format strings, rather than just relying on the position of each conversion specification. To give a trivial example: Becomes: I use this technique all the … Continue reading

Posted in Ocaml, Python | 15 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

Analyzing logfiles (1)

One powerful technique I often use is to quickly load application or system logs into throwaway SQLite databases for analysis. This means I can easily run queries such as, how many times has event X occurred broken down by hour, … Continue reading

Posted in Linux, Ocaml, SQLite | 4 Comments

OCaml at Xen

Another interesting article, this one on XenSource’s experience using OCaml on large, mission-critical software. We use Xen at work…

Posted in Ocaml, Random thoughts | Leave a comment


An excellent post from Yossi Kreinin that almost exactly mirrors my own experience. Forth to me seems very much like how computers should be programmed. I have Leo Brodie’s book and I love it. Out of habit I apt-get install … Continue reading

Posted in Random thoughts | Leave a comment

Using OCaml with Oracle (2)

In this post I am going to present a trivial application that nonetheless is representative of “real work” – parsing a command line, connecting to Oracle, running a query, processing the results and generating a report. I suppose it is … Continue reading

Posted in Linux, Ocaml, Oracle | 6 Comments

Yaron Minsky (Jane St) on Effective ML

Posted in Ocaml | Leave a comment