This homework must be done individually. No copying is permitted.
data XML = Element String [XML] | Text StringFor example, the XML data <q><s>y</s>d<s>z</s></q> is constructed using
Element "q" [ Element "s" [Text "y"], Text "d", Element "s" [Text "z"] ]Write a recursive Haskell function count of type XML->Int that counts the total number of nodes in XML data (Element and Text nodes). For example, it must return 6 for the above XML data.
Use the form below to submit your homework. We do not accept email or hardcopy submissions. Acceptable file formats for your submitted file are: plain text, Microsoft Word document (.doc), PDF (.pdf), and postscript (.ps). Don't forget to put your name and student ID on your homework. You may submit your file as many times as you like, but only the most recently submitted file will be retained and evaluated.
Last modified: 26/04/11 by Leonidas Fegaras