title: Recursive function and stopping condition in Haskell
body: <p>I am implementing a recursive function and I want the stopping condition be <strong>(2*scope)</strong> which is parameter to function</p>
  
  <pre><code>sortByManhattanDistance agent (2*scope) scope xs sortedNearFoodList = sortedNearFoodList
  
  sortByManhattanDistance agent n scope xs sortedNearFoodList = sortByManhattanDistance agent (n+1) scope xs (sorted ++ sortedNearFoodList) 
  where sorted=compareManhattanDistance xs agent n
  </code></pre>
  
  <p>and hugs complain that: <code>Syntax error in declaration (unexpected symbol "*")</code>
  Does it mean that I cannot use some function on parameters?</p>
  
  <p>thanks in advance</p>