Implementation of task for ICFP 2006