<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>Simple Table Update</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi,<BR>
<BR>
I'd like to create a new list based on an original list, using information from a second (symbol) list. That second list should be updated as each element in the new list is added. I've been using map a lot, but that's not an option here, and I'm having trouble obtaining a good recursive structure for my function.<BR>
<BR>
The minimal &quot;fixpus&quot; function below shows the problem. I have &quot;sts&quot; on both sides of the &quot;:&quot; list construct, but I'd like the second &quot;sts&quot; to be a version modified by the where (singular) function, &quot;fixpu&quot;.<BR>
<BR>
fixpus :: [ProgUnit] -&gt; [ProgUnitSymbolTable] -&gt; [ProgUnit]<BR>
fixpus []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _&nbsp; = []<BR>
fixpus (pu:pus) sts = fixpu pu sts : fixpus pus sts<BR>
<BR>
&nbsp; where fixpu pu sts = pu<BR>
<BR>
(Below) I tried making &quot;fixpu&quot; return a tuple, and then use &quot;fst&quot;, &quot;snd&quot; and &quot;let&quot;, but I think it looks strange. I know it's quite basic, but I'd like a strong foundation for what's likely to become a medium-scale project. Can anyone offer advice?<BR>
<BR>
fixpus :: [ProgUnit] -&gt; [ProgUnitSymbolTable] -&gt; [ProgUnit]<BR>
fixpus []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _&nbsp; = []<BR>
fixpus (pu:pus) sts = let a = (fixpu pu sts) in fst a : fixpus pus (snd a)<BR>
<BR>
&nbsp; where fixpu pu sts = (pu,sts ++ [(&quot;&quot;,[])])<BR>
<BR>
Regards,<BR>
Paul<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>