Group is
+ ../../smlnj-lib/sources.cm
+ ../../map.sml
+
../../config.sml
- ../../mlton_util.sig
- ../../mlton_util.sml
+ ../../util.sig
+ ../../util.sml
../config.sml
open Config
open ApacheConfig
-open MltonUtil
+open Util
val groupsBase = wblDocDir ^ "/" ^ defaultHost ^ "/url_"
(* Where to look for grouped user statistics *)
Group is
- (*$/basis.cm*)
-
- (*smlnj-lib/lib-base-sig.sml
- smlnj-lib/lib-base.sml
- smlnj-lib/ord-key-sig.sml
- smlnj-lib/ord-map-sig.sml
- smlnj-lib/binary-map-fn.sml
- smlnj-lib/ord-set-sig.sml
- smlnj-lib/binary-set-fn.sml*)
smlnj-lib/sources.cm
config.sml
+++ /dev/null
-(*
-Domtool (http://hcoop.sf.net/)
-Copyright (C) 2004-2005 Adam Chlipala
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*)
-
-(* Utility functions for MLton programs *)
-
-signature MLTON_UTIL =
-sig
- val mergeSort : ('a * int) list -> ('a * int) list
- (* Sort the argument list in descending integer order. *)
-end
+++ /dev/null
-(*
-Domtool (http://hcoop.sf.net/)
-Copyright (C) 2004-2005 Adam Chlipala
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*)
-
-(* Utility functions *)
-
-structure MltonUtil :> MLTON_UTIL =
-struct
- fun merge (L1 : ('a * int) list, L2 : ('a * int) list) acc =
- case (L1, L2) of
- (_, []) => List.revAppend (acc, L1)
- | ([], _) => List.revAppend (acc, L2)
- | (n1::t1, n2::t2) =>
- if #2 n1 > #2 n2 then
- merge (t1, L2) (n1 :: acc)
- else
- merge (L1, t2) (n2 :: acc)
-
- fun split n L acc =
- if n <= 0 then
- (acc, L)
- else
- case L of
- [] => (acc, [])
- | h::t => split (n-1) t (h::acc)
-
- fun mergeSort L =
- case L of
- [] => L
- | [a] => L
- | _ =>
- let
- val mid = length L div 2
- val (L1, L2) = split mid L []
- in
- merge (mergeSort L1, mergeSort L2) []
- end
-end
-
val enrichSetFromFile : string * StringSet.set -> StringSet.set
(* Add the entries in the file to the set.
* A "CLEAR" entry clears the set. *)
+
+ val mergeSort : ('a * int) list -> ('a * int) list
+ (* Sort the argument list in descending integer order. *)
end
else
set
end
+
+ fun merge (L1 : ('a * int) list, L2 : ('a * int) list) acc =
+ case (L1, L2) of
+ (_, []) => List.revAppend (acc, L1)
+ | ([], _) => List.revAppend (acc, L2)
+ | (n1::t1, n2::t2) =>
+ if #2 n1 > #2 n2 then
+ merge (t1, L2) (n1 :: acc)
+ else
+ merge (L1, t2) (n2 :: acc)
+
+ fun split n L acc =
+ if n <= 0 then
+ (acc, L)
+ else
+ case L of
+ [] => (acc, [])
+ | h::t => split (n-1) t (h::acc)
+
+ fun mergeSort L =
+ case L of
+ [] => L
+ | [a] => L
+ | _ =>
+ let
+ val mid = length L div 2
+ val (L1, L2) = split mid L []
+ in
+ merge (mergeSort L1, mergeSort L2) []
+ end
end