title: Haskell: Function using do notation and returning i.e. Integer value
body: <p>I want to write a function that read some data using <code>getLine</code> and return i.e. a tuple (Integer, Integer) but using do-notation. Something like this (of course it doesn't work):</p>
  
  <pre><code>fun :: (Integer, Integer)
  fun = do
      a &lt;- read (getLine::Integer)
      b &lt;- read (getLine::Integer)
      return (a, b)
  </code></pre>
  
  <p>Do I have to write my own monad for this? Is there any solution to not writing a new monad?</p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>So I can write <code>main</code> function that use <code>fun</code>, I think it's the only solution:</p>
  
  <pre><code>main :: IO ()
  main = do
      tuple &lt;- fun
      putStrLn (show tuple)
  
  fun :: IO (Integer, Integer)
  fun = do
      a1 &lt;- getLine
      b1 &lt;- getLine
      let a = read (a1)
          b = read (b1)
      return (a, b)
  </code></pre>
  
  <p>And above code works.</p>