 +      fprintf ppf "This functor is impure. It can only be applied to ()"
 Index: typing/typemod.mli
 ===================================================================
---- typing/typemod.mli	(revision 13274)
+--- typing/typemod.mli	(revision 13278)
 +++ typing/typemod.mli	(working copy)
 @@ -60,6 +60,7 @@
    | Not_a_packed_module of type_expr

 
Index: typing/oprint.ml
===================================================================
--- typing/oprint.ml	(revision 13274)
+++ typing/oprint.ml	(working copy)
@@ -343,6 +343,8 @@
 let rec print_out_module_type ppf =

       rm { mod_desc = Tmod_functor(id, name, mty, body);
            mod_type = Mty_functor(id, mty.mty_type, body.mod_type);
            mod_env = env;
@@ -845,6 +848,13 @@
         type_module (sttn && path <> None) funct_body None env sfunct in
       begin match Mtype.scrape env funct.mod_type with
         Mty_functor(param, mty_param, mty_res) as mty_functor ->
+          let impure = Ident.name param = "*" in
+          if impure then begin
+            if sarg.pmod_desc <> Pmod_structure [] then
+              raise (Error (sfunct.pmod_loc, Apply_impure));
+            if funct_body then
+              raise (Error (smod.pmod_loc, Not_allowed_in_functor_body));
+          end;
           let coercion =
             try
               Includemod.modtypes env arg.mod_type mty_param
@@ -856,6 +866,7 @@
                 Subst.modtype (Subst.add_module param path Subst.identity)
                               mty_res
             | None ->
