<?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="2006/02/fd6ef9c32a1154859f9e54b6bb5cc903"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T18:07:59"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code..."
  prev="2006/02/6112bba539b885c93cae0b63530988e6"
  next="2006/02/851635eb4ffea2ab9bcb25f9d631b133"
  prev-in-thread="2006/02/bf71ca3b5daf28ccce08502c2ddb44c1"
  next-in-thread="2006/02/9b2c9649dc1d9a818d594d31a03a0cc3"
  prev-thread="2006/02/99506d5ef7ec01d8ba9bb0294eb03130"
  next-thread="2006/02/b801b6e1958639194014abd51a4747a3"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/123aec67dc0623c495431e677bee71af"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-04T21:20:33"
  subject="From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/e53f4724f2819ce035bbef253c1ad50d"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2006-02-05T02:29:21"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/1cc4eb9caf947ecb2db08eeeab666e06"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T04:16:45"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/b32d0834fbcd7a60f3f0b85810c4df58"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2006-02-05T05:42:57"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/cad55e9864fd32dc1bca71af3652756c"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T14:18:11"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/bf71ca3b5daf28ccce08502c2ddb44c1"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2006-02-05T16:05:58"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/fd6ef9c32a1154859f9e54b6bb5cc903"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T18:07:59"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
</msg>
</msg>
<msg 
  url="2006/02/9b2c9649dc1d9a818d594d31a03a0cc3"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-06T11:52:54"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/75e2c039deb5f9ba01262efea3520cbd"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-06T13:11:23"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
</msg>
</msg>
<msg 
  url="2006/02/7f7e09a3fbd0f018ef0d3dc2ee681335"
  from="Bill Wood &lt;william.wood3@c...&gt;"
  author="Bill Wood"
  date="2006-02-05T05:55:56"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/c119a7c5b3e0b302637e066205f9cab2"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-05T11:21:43"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursiveOCaml-code...">
</msg>
</msg>
<msg 
  url="2006/02/29419a2121fc6b9d34429f4b6bd67cc8"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T23:24:42"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/a7b29009021a2ec0bc7a53139a5e811a"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T23:47:28"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
<msg 
  url="2006/02/5e787d033f1ee4778e7d546ef0676403"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2006-02-06T03:39:47"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2006/02/03b9b5269e4dd4d9eaa994c3d3fac833"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T11:46:35"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
<msg 
  url="2006/02/ac8c0b52e160013bbec74e1efdf70e0f"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T18:20:15"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
</msg>
</thread>

<contents>
On Mon, Feb 06, 2006 at 03:05:45AM +1100, skaller wrote:
&gt; On Sun, 2006-02-05 at 15:17 +0100, Oliver Bandel wrote:
&gt; 
&gt; Looking at 
&gt; 
&gt; http://www.belug.org/~ob/struktur-grafisch.jpg
&gt; 
&gt; the bottom diagram, I would do this:
&gt; 
&gt; type state = { e:t; u:t }
&gt; 
&gt; for some type t I don't know about, possibly the types
&gt; are different, but this will do for exposition.
&gt; 
&gt; You also have arrows
&gt; 
&gt; 	a: t * t -&gt; t
&gt; 	b: t * t -&gt; t
&gt; 	c: t -&gt; t
[...]


Ah, OK, that's fine to start with the type! :)

Starting the task with the type clarifies a lot! :)



&gt; 
&gt; So the clock function is simply
&gt; 
&gt; 	let step (s:state) x =
&gt; 	{ s with 
&gt; 		e = c s.u;
&gt; 		u = b (x, s.e)
&gt; 	} 
&gt; 	in s, a (x, s.e)

OK, that's nice... I had forgotten how (but knew that I once knew
that it must be possible) to make a functional record-update-copy.
The "with" keyword is a fine thing. :)
Looks so much smaller the code, much nicer than the let...in stuff :)


&gt; 
&gt; This function accepts the state and a new input x,
&gt; and returns the state and the output y. 

OK, I will explore it.

Thanks.


Ciao,
   Oliver

</contents>

</message>

