title: How to input an integer in haskell? (input in console)
body: <p>How can I enter an integer in the console, store it in a variable and then pass it as a parameter of a function that I have created?</p>
  
  <p>So far so that it works I had to do as follows:</p>
  
  <p>In the last line you can see how I have been applying the function, what I want to do is to ask for the variables by console to be applied as integers to the function and then print the result.</p>
  
  <pre><code>    mayor :: Int -&gt; Int -&gt; Double
      mayor x y =
          if  x &lt; y 
          then 0.1
              else 0.3
  
  
      compra :: Int -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; Double
      compra n v u iva p vp =
          let valor_compra = (fromIntegral v) * (fromIntegral n) * (1 - mayor n u)
              valor_iva = valor_compra * (fromIntegral iva) / 100
              valor_puntos = fromIntegral (p * vp)
              efectivo = if (valor_puntos &lt; valor_compra) then valor_compra-valor_puntos else 0
          in  valor_iva + efectivo
  
      main = do
      print (compra 20 2000 7 14 10 1500)
  </code></pre>
  
  <p>The way I do it gives me as a result
  16920.0</p>