To get another perspective, let&#39;s eliminate some unnecessary naming and see what linear pipelines emerge:<br><blockquote style="font-family: courier new,monospace;">process item mediaKind mediaSize language =<br>&nbsp; let (numberedQuestions,questionCategories) =
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numberQuestions pagemaster $<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stripUndisplayedQuestions mediaKind $<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; appendEndQuestions item<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (loadPagemaster item mediaKind mediaSize) $<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; coalesceParentedQuestions $<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validateQuestionContent $<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loadQuestions item<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (bands,sequenceLayouts) =<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buildLayout mediaKind language $<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; coalesceNAQuestions $<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numberedQuestions<br>&nbsp; in<br>&nbsp;&nbsp;&nbsp;&nbsp; flip combineRows sequenceLayouts $
<br>&nbsp;&nbsp;&nbsp;&nbsp; paginate item mediaKind mediaSize pagemaster $<br>&nbsp;&nbsp;&nbsp;&nbsp; groupBands $<br>&nbsp;&nbsp;&nbsp;&nbsp; resolveCrossReferences $<br>&nbsp;&nbsp;&nbsp;&nbsp; bands<br></blockquote>Warning: I haven&#39;t tried to type-check and may have made a clerical error.&nbsp; Since questionCategories isn&#39;t used, use &quot;fst&quot; &amp; eliminate another let.&nbsp; Then, for my personal preference, and just to mix things up, switch to &quot;where&quot; style:
<br><br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">process item mediaKind mediaSize language =</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp; flip combineRows sequenceLayouts $</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; paginate item mediaKind mediaSize pagemaster $</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp; groupBands $</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; resolveCrossReferences $</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp; bands</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;where</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp; (bands,sequenceLayouts) =</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; buildLayout mediaKind language $</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; coalesceNAQuestions $</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp;&nbsp; fst $</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; numberQuestions pagemaster $</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp;&nbsp; stripUndisplayedQuestions mediaKind $</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; appendEndQuestions item</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (loadPagemaster item mediaKind mediaSize) $</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; coalesceParentedQuestions $
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; validateQuestionContent $</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp;&nbsp; loadQuestions item</span><br></div><br>Not quite a work of art yet, but the structure is getting clearer to me.<br><br><br><br><br><div><span class="gmail_quote">On 12/28/06, <b class="gmail_sendername">Steve Schafer
</b> &lt;<a href="mailto:steve@fenestra.com">steve@fenestra.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Tue, 26 Dec 2006 20:21:45 -0800, you wrote:
<br><br>&gt;How would this example look if you named only multiply-used expressions?<br>&gt;I&#39;d like to see it in a more conventional pointful style with nested<br>&gt;expressions.&nbsp;&nbsp;I&#39;m still wondering whether the awkwardness results from your
<br>&gt;writing style or is more inherent.&nbsp;&nbsp;Showing the real variable names may also<br>&gt;help also.<br><br>This is what it looks like &quot;for real&quot;:<br><br>&gt; process :: Item -&gt; MediaKind -&gt; MediaSize -&gt; Language -&gt; SFO
<br>&gt; process item mediaKind mediaSize language =<br>&gt;&nbsp;&nbsp; let pagemaster = loadPagemaster item mediaKind mediaSize;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; questions = stripUndisplayedQuestions mediaKind $<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; appendEndQuestions item pagemaster $
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; coalesceParentedQuestions $<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validateQuestionContent $<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loadQuestions item;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(numberedQuestions,questionCategories) = numberQuestions pagemaster questions;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numberedQuestions&#39; = coalesceNAQuestions numberedQuestions;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(bands,sequenceLayouts) = buildLayout mediaKind language numberedQuestions&#39;;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bands&#39; = resolveCrossReferences bands;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;groupedBands = groupBands bands&#39;;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pages = paginate item mediaKind mediaSize pagemaster groupedBands;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pages&#39; = combineRows pages;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sfo = pages&#39; sequenceLayouts;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in sfo<br><br>These are the function signatures:<br><br>&gt; loadPagemaster :: Item -&gt; MediaKind -&gt; MediaSize -&gt; Pagemaster<br>&gt; loadQuestions :: Item -&gt; [Question]<br>&gt; validateQuestionContent :: [Question] -&gt; [Question]
<br>&gt; coalesceParentedQuestions :: [Question] -&gt; [Question]<br>&gt; appendEndQuestions :: Item -&gt; Pagemaster -&gt; [Question] -&gt; [Question]<br>&gt; stripUndisplayedQuestions :: MediaKind -&gt; [Question] -&gt; [Question]
<br>&gt; numberQuestions :: Pagemaster -&gt; [Question] -&gt; ([NumberedQuestion],[QuestionCategory])<br>&gt; coalesceNAQuestions :: [NumberedQuestion] -&gt; [NumberedQuestion]<br>&gt; buildLayout :: MediaKind -&gt; Language -&gt; [NumberedQuestion] -&gt; ([Band],[SequenceLayout])
<br>&gt; resolveCrossReferences :: [Band] -&gt; [Band]<br>&gt; groupBands :: [Band] -&gt; [[Band]]<br>&gt; paginate :: Item -&gt; MediaKind -&gt; MediaSize -&gt; Pagemaster -&gt; [[Band]] -&gt; [Page]<br>&gt; combineRows :: [Page] -&gt; [Page]
<br>&gt; createSFO :: [Page] -&gt; [SequenceLayout] -&gt; SFO<br><br>MediaKind, MediaSize and Language are simple enumerations; everything<br>else is a complex structure.<br><br>Steve Schafer<br>Fenestra Technologies Corp.
<br><a href="http://www.fenestra.com/">http://www.fenestra.com/</a><br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a>
<br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></blockquote></div><br>