On Tue, 26 Dec 2006 20:21:45 -0800, you wrote: >How would this example look if you named only multiply-used expressions? >I'd like to see it in a more conventional pointful style with nested >expressions. I'm still wondering whether the awkwardness results from your >writing style or is more inherent. Showing the real variable names may also >help also.
This is what it looks like "for real": > process :: Item -> MediaKind -> MediaSize -> Language -> SFO > process item mediaKind mediaSize language = > let pagemaster = loadPagemaster item mediaKind mediaSize; > questions = stripUndisplayedQuestions mediaKind $ > appendEndQuestions item pagemaster $ > coalesceParentedQuestions $ > validateQuestionContent $ > loadQuestions item; > (numberedQuestions,questionCategories) = numberQuestions pagemaster > questions; > numberedQuestions' = coalesceNAQuestions numberedQuestions; > (bands,sequenceLayouts) = buildLayout mediaKind language > numberedQuestions'; > bands' = resolveCrossReferences bands; > groupedBands = groupBands bands'; > pages = paginate item mediaKind mediaSize pagemaster groupedBands; > pages' = combineRows pages; > sfo = pages' sequenceLayouts; > in sfo These are the function signatures: > loadPagemaster :: Item -> MediaKind -> MediaSize -> Pagemaster > loadQuestions :: Item -> [Question] > validateQuestionContent :: [Question] -> [Question] > coalesceParentedQuestions :: [Question] -> [Question] > appendEndQuestions :: Item -> Pagemaster -> [Question] -> [Question] > stripUndisplayedQuestions :: MediaKind -> [Question] -> [Question] > numberQuestions :: Pagemaster -> [Question] -> > ([NumberedQuestion],[QuestionCategory]) > coalesceNAQuestions :: [NumberedQuestion] -> [NumberedQuestion] > buildLayout :: MediaKind -> Language -> [NumberedQuestion] -> > ([Band],[SequenceLayout]) > resolveCrossReferences :: [Band] -> [Band] > groupBands :: [Band] -> [[Band]] > paginate :: Item -> MediaKind -> MediaSize -> Pagemaster -> [[Band]] -> [Page] > combineRows :: [Page] -> [Page] > createSFO :: [Page] -> [SequenceLayout] -> SFO MediaKind, MediaSize and Language are simple enumerations; everything else is a complex structure. Steve Schafer Fenestra Technologies Corp. http://www.fenestra.com/ _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe