title: Haskell - How to use a function that returns 'Maybe Int' as an argument to another function?
body: <p>When I have the two functions:</p>
  
  <p>a)</p>
  
  <pre><code>three :: Int -&gt; Maybe Int
  three a
   | a == 3 = Just 3
   | otherwise = Nothing
  </code></pre>
  
  <p>b)</p>
  
  <pre><code>takeOne :: Int -&gt; Int
  takeOne a = (a - 1)
  </code></pre>
  
  <p>how do I call function a as a parameter to function b? i.e How do I let function b accept a 'Maybe Int' in place of an 'Int'?</p>
  
  <p>At the minute when I try</p>
  
  <pre><code>takeOne (three 3)
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>ERROR - Type error in application
  *** Expression     : takeThree (three 3)
  *** Term           : three 3
  *** Type           : Maybe Int
  *** Does not match : Int
  </code></pre>
  
  <p>Thanks.</p>