title: Write a function that counts the number of elements in a rosetree
body: <p>Write a function
  that counts the number of elements in a rosetree.</p>
  
  <p>I tried counts the number of elements in a rosetree.</p>
  
  <pre><code>data RoseTree a = RoseNode a [RoseTree a]
      deriving Show
  things :: RoseTree String
  things = 
      RoseNode "thing" [
          RoseNode "animal" [
              RoseNode "cat" [], RoseNode "dog" []
          ],
  
          RoseNode "metal" [
              RoseNode "alloy" [
                  RoseNode "steel" [], RoseNode "bronze" []
              ],
              RoseNode "element" [
                  RoseNode "gold" [], RoseNode "tin" [], RoseNode "iron" []
              ]
          ],
  
          RoseNode "fruit" [
              RoseNode "apple" [
                  RoseNode "Granny Smith" [], RoseNode "Pink Lady" []
              ],
              RoseNode "banana" [],
              RoseNode "orange" []
          ],
  
          RoseNode "astronomical object" [
              RoseNode "Planet" [
                  RoseNode "Earth" [], RoseNode "Mars" []
              ],
              RoseNode "Star" [
                  RoseNode "The Sun" [], RoseNode "Sirius" []
              ],
              RoseNode "Galaxy" [
                  RoseNode "Milky Way" []
              ]
          ]
      ] 
  </code></pre>
  
  <p>It should be 27, however, it returns 4.</p>
  
  <p><strong>EDIT:</strong> Here is my attempt:</p>
  
  <pre><code>roseSize x = case x of
      RoseNode a [] -&gt; 0
      RoseNode a (x:xs) -&gt; 1 + roseSize (RoseNode a xs)
  </code></pre>