 +    /* We want to import everything in this module. */
 +    fprintf(f, "-- Automatically generated --\n");
 +    fprintf(f, "{-# LANGUAGE OverloadedStrings #-}\n");
-+    fprintf(f, "module NetHack.Imported.ReplaceThisName where\n\n");
++    fprintf(f, "module NetHack.Imported.%s ( variant ) where\n\n"
++           , variant );
 +    fprintf(f, "import qualified Data.Text as T\n");
 +    fprintf(f, "import qualified NetHack.Data.Dice as D\n");
++    fprintf(f, "import qualified NetHack.Data.Variant as V\n");
 +    fprintf(f, "import NetHack.Data.Monster\n\n");
++
++    fprintf(f, "variant :: V.Variant\n");
++    fprintf(f, "variant = V.variant monster allMonsterNames \"%s\"\n\n"
++             , command_prefix );
 +
 +    fprintf(f, "monster :: T.Text -> Maybe Monster\n");
 +    fprintf(f, "monster name\n");

+    return 0;
+}
+
+static void extract_monsterdata_to_haskell(FILE* f)
+{
+    int i1, i2;
+    struct permonst* pm;

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