title: Writing basic haskell function, taking Int x and doing function on [1..x]
body: <p>I'm practicing some haskell, and having issues with something very basic in other languages.</p>
  
  <p>I want my function to take an int and return a string</p>
  
  <pre><code>oddOnly :: Int -&gt; String
  </code></pre>
  
  <p>and i want to print the output of that function</p>
  
  <pre><code>print (oddOnly 20)
  </code></pre>
  
  <p>I want this function to print all odd numbers from 1-20 for example</p>
  
  <pre><code>"1 3 5 7 9 11 13 15 17 19"
  </code></pre>
  
  <p>My function is only printing the final number obviously because i'm not iterating over a list of these numbers.  How do I do that?</p>
  
  <pre><code>oddOnly x
      | x &lt; 0 = error "neg"
      | x == 0 = "0"
      | mod x 2 /= 0 = show x
  </code></pre>