Entry for ICFP 2013 programming contest