title: length of list using foldr in haskell
body: <p>I wrote the following code to calculate length of a list using foldr in haskell. When I compile the code it gives me error as  "myfoldr.hs:3:1: parse error on input `where'". Can anyone please tell me what thing I might be missing or doing wrong in this code ?</p>
  
  <pre><code>mylength :: [Int] -&gt; Int
  mylength l = foldr f 0 l
  where
  f :: Int -&gt; Int -&gt; Int
  f x y = y+1
  </code></pre>