<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/10/082653152d78e76edce7de62398f8c1f"
  from="David Brown &lt;caml-list@d...&gt;"
  author="David Brown"
  date="2003-10-24T07:53:03"
  subject="Re: [Caml-list] newbie type problem"
  prev="2003/10/9e4d0c48d7066d16614195d454ef1c0d"
  next="2003/10/a7c47b1fe652cbc379e868c63cd6fa6f"
  prev-in-thread="2003/10/9e4d0c48d7066d16614195d454ef1c0d"
  next-in-thread="2003/10/a7c47b1fe652cbc379e868c63cd6fa6f"
  prev-thread="2003/10/e7f6c0d5605db8954852475f246f1109"
  next-thread="2003/10/ef7ea5a38d2bceb896eb567f1eff1764"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] newbie type problem">
<msg 
  url="2003/10/2e8a6962baf66f1c24c5f132e0e4d98a"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-24T06:11:43"
  subject="[Caml-list] newbie type problem">
<msg 
  url="2003/10/1ec46ca647143db0b89bf64b3fe444da"
  from="David Brown &lt;caml-list@d...&gt;"
  author="David Brown"
  date="2003-10-24T06:32:48"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/9e4d0c48d7066d16614195d454ef1c0d"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-24T06:54:14"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/082653152d78e76edce7de62398f8c1f"
  from="David Brown &lt;caml-list@d...&gt;"
  author="David Brown"
  date="2003-10-24T07:53:03"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/a7c47b1fe652cbc379e868c63cd6fa6f"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-24T08:21:36"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/f70a630abcb73995f40868e5b4aedd5d"
  from="Andrew Lenharth &lt;andrewl@d...&gt;"
  author="Andrew Lenharth"
  date="2003-10-24T12:50:08"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/4046091fba633875058f2de17f0ff1e7"
  from="Remi Vanicat &lt;vanicat@l...&gt;"
  author="Remi Vanicat"
  date="2003-10-24T13:21:26"
  subject="Re: [Caml-list] newbie type problem">
</msg>
</msg>
<msg 
  url="2003/10/1271d8cb3491b0027667093a335ee94e"
  from="Florian Hars &lt;hars@b...&gt;"
  author="Florian Hars"
  date="2003-10-29T07:23:31"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/f070014a1ae9dad3251d6334d87f1555"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-29T08:03:55"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/669fd0c0dff2b0a039406b7cb928916d"
  from="Florian Hars &lt;hars@b...&gt;"
  author="Florian Hars"
  date="2003-10-29T16:27:29"
  subject="Re: [Caml-list] newbie type problem">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/10/bc22b36f43b4dd5f6d7af456fd0801fc"
  from="Hendrik Tews &lt;tews@t...&gt;"
  author="Hendrik Tews"
  date="2003-10-24T09:25:16"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/196dea4817e90f7281ee0ccc73dd15a7"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-24T16:23:13"
  subject="Re: [Caml-list] newbie type problem">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
On Thu, Oct 23, 2003 at 11:54:07PM -0700, Dustin Sallings wrote:

&gt; { 0: &lt;
&gt; 	pb_counts = { "T1": 23, "T2": 43 }
&gt; 	pb_times = { "T1": 291, "T2": 92 }
&gt; 	&gt;
&gt;   300: &lt;
&gt; 	pb_counts = { "T1": 29, "T2": 50 }
&gt; 	pb_times = { "T1": 202, "T2": 87 }
&gt; 	&gt;
&gt; }
&gt; 
&gt; 	When I spell it out that way, it looks a little less than optimal.  
&gt; However, this is more of a learning tool at this point.

You may want to consider putting the data for a given transaction type
into its own type, and having that be the target of the hashtbl.

   type transaction_info = {
     mutable counts : int;
     mutable times : int;
   }

Then your results could just be a

   (int * (string, transaction_info) Hashtbl.t) list

Dave

BTW, this actually seems like a good problem for learning the language.
I seem to always choose things too difficult, and end up getting
frustrated.

BTW, I have found the .mli files for the libraries to be the best
documentation.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

