---- /nethack-3.4.3/sys/unix/unixmain.c	2003-12-08 01:39:13.000000000 +0200
-+++ unixmain.c	2013-05-09 22:30:04.976771342 +0300
+--- /home/shannon/gitjutut/nethack-3.4.3/sys/unix/unixmain.c	2003-12-08 01:39:13.000000000 +0200
++++ unixmain.c	2013-05-13 18:18:59.100622410 +0300
 @@ -44,11 +44,15 @@
  static boolean wiz_error_flag = FALSE;
  #endif

+
+/*** EXTRACTOR STUFF ***/
+
+static void extract_monsterdata_to_haskell(FILE* f);
+static void extract_itemdata_to_haskell(FILE* f);
+
+static int extract_data(int argc, char* argv[])
+{
+    FILE* f;
+
+    if (argc <= 1)
+    {
+        printf("Usage:\n");
+        printf("%s [language]\n\n", argv[0]);
+        printf("Where language is one of: \n");
+        printf("  haskell [monster-data-file] [item-data-file]\n\n");
+        printf("Monster data file defaults to MonsterData.hs and \n");
+        printf("item data file defaults to ItemData.hs.\n\n");
+        return 0;
+    }
+
+    if (argc >= 2 && !strcmp(argv[1], "haskell"))
+    {
+        if (argc >= 3)
+            f = fopen(argv[2], "wb");
+        else
+            f = fopen("MonsterData.hs", "wb");
+        if (!f)
+        {
+            perror("fopen");
+            return -1;
+        }
+        extract_monsterdata_to_haskell(f);
+        fclose(f);
+
+        if (argc >= 4)
+            f = fopen(argv[3], "wb");
+        else
+            f = fopen("ItemData.hs", "wb");
+
+        if (!f)
+        {
+            perror("fopen");
+            return -1;
+        }
+
+        extract_itemdata_to_haskell(f);
+        fclose(f);
+    }
+    else
+    {

 	register int fd;
 #ifdef CHDIR
 	register char *dir;
@@ -538,4 +542,439 @@
 	return;
 }
 
