Fix regeneration of multi-file dependencies
[hcoop/domtool2.git] / src / order.sml
index 14bd01e..b58c9f7 100644 (file)
@@ -300,24 +300,24 @@ fun order basisOpt fnames =
            order basisOpt (List.filter (fn fname => not (SS.member (!naughtyFiles, fname))) fnames)
     end
 
-fun order basisOpt fnames =
-    let
-       val (providers, fnames) = order basisOpt fnames
-
-       val (hasLib, fnames) = foldl (fn (fname, (hasLib, fnames)) =>
-                                        if OS.Path.file fname = "lib.dtl" then
-                                            (SOME fname, fnames)
-                                        else
-                                            (hasLib, fname :: fnames))
-                              (NONE, []) fnames
-
-       val fnames = rev fnames
-       val fnames = case hasLib of
-                        NONE => fnames
-                      | SOME hasLib => hasLib :: fnames
-    in
-       (providers, fnames)
-    end
+val order = fn basisOpt => fn fnames =>
+                             let
+                                 val (providers, fnames) = order basisOpt fnames
+
+                                 val (hasLib, fnames) = foldl (fn (fname, (hasLib, fnames)) =>
+                                                                  if OS.Path.file fname = "lib.dtl" then
+                                                                      (SOME fname, fnames)
+                                                                  else
+                                                                      (hasLib, fname :: fnames))
+                                                              (NONE, []) fnames
+
+                                 val fnames = rev fnames
+                                 val fnames = case hasLib of
+                                                  NONE => fnames
+                                                | SOME hasLib => hasLib :: fnames
+                             in
+                                 (providers, fnames)
+                             end
 
 type providers = {provideC : string SM.map,
                  provideT : string SM.map,