<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>anneal.ml</filename>
    </added>
    <added>
      <filename>test/exTspTest.ml</filename>
    </added>
    <added>
      <filename>test/toolsTest.ml</filename>
    </added>
    <added>
      <filename>tools.ml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,8 +1,13 @@
 TARGETS=\
-	$(patsubst test/%Test.ml,test/%Test.byte,$(wildcard test/*Test.ml))
+	$(patsubst test/%Test.ml,test/%Test.byte,$(wildcard test/*Test.ml))\
+	$(patsubst ex/%Run.ml,ex/%Run.native,$(wildcard ex/*Run.ml))
 
-OCAMLBUILD=ocamlbuild -classic-display
+OCAMLBUILD=ocamlbuild -classic-display -I ex
 
 .PHONY: build
 build:
 	$(OCAMLBUILD) $(TARGETS)
+
+.PHONY: clean
+clean:
+	$(OCAMLBUILD) -clean</diff>
      <filename>Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,7 @@ let tail seq =
         Lazy.force q
 
 
-(* Construction helpers *)
+(* Transformation helpers *)
 
 let rec of_list lst =
     match lst with
@@ -37,6 +37,16 @@ let rec of_list lst =
     | [] -&gt;
         Nil
 
+let to_list seq =
+    let rec _to_list seq acc =
+        match head seq with
+        | Some h -&gt;
+            _to_list (tail seq) (h::acc)
+        | None -&gt;
+            List.rev acc
+    in
+    _to_list seq []
+
 let rec of_serie fn n0 =
     Cons(n0, lazy (of_serie fn (fn n0)))
 
@@ -78,3 +88,31 @@ let rec filter pred seq =
         else
             filter pred (tail seq)
 
+let rec concat seqs =
+    match seqs with
+    | h :: a -&gt;
+        begin
+        match head h with
+        | None -&gt;
+            concat a
+        | Some e -&gt;
+            Cons(e, lazy (concat ((tail h) :: a)))
+        end
+    | [] -&gt;
+        Nil
+
+let rec cart seqs =
+    match seqs with
+    | [] -&gt;
+        Nil
+    | h :: [] -&gt;
+        map (fun e -&gt; [e;]) h
+    | h :: a -&gt;
+        match head h with
+        | None -&gt;
+            Nil
+        | Some e -&gt;
+            concat [
+                (map (fun c -&gt; e :: c) (cart a));
+                (cart ((tail h) :: a));
+            ]</diff>
      <filename>seq.ml</filename>
    </modified>
    <modified>
      <diff>@@ -43,10 +43,11 @@ let _ = Tests.register &quot;Base: head_exn&quot; (fun () -&gt;
     OUnit.assert_raises Seq.EmptySeq (fun () -&gt; Seq.head_exn s)
 )
 
-let _ = Tests.register &quot;Helper: of_list&quot; (fun () -&gt;
+let _ = Tests.register &quot;Helper: of_list, to_list&quot; (fun () -&gt;
     let l = [1;2;3;] in
     let s = Seq.of_list l in
-    _cmp_to_list_end s l
+    _cmp_to_list_end s l;
+    OUnit.assert_equal l (Seq.to_list s)
 )
 
 let _ = Tests.register &quot;Helper: of_serie&quot; (fun () -&gt;
@@ -91,4 +92,29 @@ let _ = Tests.register &quot;filter&quot; (fun () -&gt;
     _cmp_to_list_end f [0;2;4;6;8;]
 )
 
+let _ = Tests.register &quot;concat&quot; (fun () -&gt;
+    let s1 = Seq.of_list [0;1;2;] in
+    let s2 = Seq.of_list [3;4;5;] in
+    let s3 = Seq.of_list [6;7;8;] in
+    let seq = Seq.concat [s1;s2;s3;] in
+    _cmp_to_list_end seq [0;1;2;3;4;5;6;7;8;]
+)
+
+let _ = Tests.register &quot;cart&quot; (fun () -&gt;
+    let s1 = Seq.of_list [0;1;] in
+    let s2 = Seq.of_list [2;3;] in
+    let s3 = Seq.of_list [4;5;] in
+    let cart = Seq.cart [s1;s2;s3] in
+    _cmp_to_list_end cart [
+        [0;2;4;];
+        [0;2;5;];
+        [0;3;4;];
+        [0;3;5;];
+        [1;2;4;];
+        [1;2;5;];
+        [1;3;4;];
+        [1;3;5;];
+    ]
+)
+
 let _ = Tests.run &quot;Seq test suite&quot;</diff>
      <filename>test/seqTest.ml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9ebe1ee4235fff84951d3ddb4ececd199c82e4ac</id>
    </parent>
  </parents>
  <author>
    <name>Ludovic Coquelle</name>
    <email>lcoquelle@gmail.com</email>
  </author>
  <url>http://github.com/khigia/ocaml-anneal/commit/f007d93080b1b0253fe3b416c969ded44608b775</url>
  <id>f007d93080b1b0253fe3b416c969ded44608b775</id>
  <committed-date>2008-06-08T08:54:29-07:00</committed-date>
  <authored-date>2008-06-08T08:54:29-07:00</authored-date>
  <message>First version of simulated annealing kind of working.</message>
  <tree>32e787185859965155a1533ca226614c6456a31c</tree>
  <committer>
    <name>Ludovic Coquelle</name>
    <email>lcoquelle@gmail.com</email>
  </committer>
</commit>
