<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div style=""
data-md-original="Hey%2C%3Cbr%3E%3Cbr%3EI%20want%20to%20write%20a%20function%2C%20which%20is%20basically%20a%20concatenation%20of%20functions%20of%20type%20%22IO%20(Maybe%20a)%22.%3Cbr%3EWhen%20they%20all%20where%20of%20type%20%22Maybe%20a%22%2C%20no%20Problem%20I%20would%20simple%20use%20the%20Maybe%20monad.%3Cbr%3E%3Cbr%3E%60%60%60haskell%3Cbr%3Efunc%20%3A%3A%20Maybe%20c%3Cbr%3Efunc%20%3D%20do%3Cbr%3E%C2%A0%20a%20%26lt%3B-%20f1%3Cbr%3E%C2%A0%20b%20%26lt%3B-%20d2%20a%3Cbr%3E%C2%A0%20...%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3Ebut%20now%20they%20are%20of%20type%20%22IO%20(Maybe%20a)%22.%20Is%20there%20some%20way%20of%20combing%20these%20in%20a%20similar%20smart%20way%3F%3Cbr%3E%3Cbr%3EThanks!%3Cbr%3ENathan%3Cbr%3E"
      class="markdown-here-wrapper" data-md-url="Thunderbird"
      id="markdown-here-wrapper-437071">
      <p style="margin: 1.2em 0px ! important;">Hey,</p>
      <p style="margin: 1.2em 0px ! important;">I want to write a
        function, which is basically a concatenation of functions of
        type “IO (Maybe a)”.<br>
        When they all where of type “Maybe a”, no Problem I would simple
        use the Maybe monad.</p>
      <pre style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;font-size: 1em; line-height: 1.2em;margin: 1.2em 0px;"><code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px 3px 3px 3px; display: inline;white-space: pre; overflow: auto; border-radius: 3px 3px 3px 3px; border: 1px solid rgb(204, 204, 204); padding: 0.5em 0.7em; display: block ! important;display: block; padding: 0.5em; color: rgb(51, 51, 51); background: none repeat scroll 0% 0% rgb(248, 248, 255);" class="language-haskell"><span style="color: rgb(153, 0, 0); font-weight: bold;" class="title">func</span> :: <span class="type">Maybe</span> c
<span style="color: rgb(153, 0, 0); font-weight: bold;" class="title">func</span> = <span style="color: rgb(51, 51, 51); font-weight: bold;" class="keyword">do</span>
  a <- f1
  b <- d2 a
  ...
</code></pre>
      <p style="margin: 1.2em 0px ! important;">but now they are of type
        “IO (Maybe a)”. Is there some way of combing these in a similar
        smart way?</p>
      <p style="margin: 1.2em 0px ! important;">Thanks!<br>
        Nathan</p>
    </div>
  </body>
</html>