<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 21, 2014 at 12:45 AM, Miguel Mitrofanov <span dir="ltr"><<a href="mailto:miguelimo38@yandex.ru" target="_blank">miguelimo38@yandex.ru</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
Actually, something like<br>
<br>
do ...<br>
    if <- checkCondition<br>
      then doReportSuccess<br>
      else doReportFailure<br>
<br>
as well as<br>
<br>
do ...<br>
    case <- generateResult of<br>
      Nothing -> ...<br>
      Just r -> ...</div></blockquote></div><br></div><div class="gmail_extra">Yes, this looks like nice syntax sugar to me. And I gather that the recent (to me, anyway) lambda-case and lambda-if have abated the incromulence:<br>


<br><a href="https://ghc.haskell.org/trac/ghc/ticket/4359" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/4359</a><br><br>Quote: "The motivating examples seem to be of the form<br>

<pre>getArgs >>= <span>case</span> of
            [] -> error "No args"
            fs -> doit fs
"</pre></div><div class="gmail_extra">So <br></div><div class="gmail_extra"><br>do ...<br>
    case <- generateResult of<br>
      Nothing -> ...<br>
      Just r -> ...<br><br></div><div class="gmail_extra">becomes<br><br></div><div class="gmail_extra">do<br>
    generateResult >>= \case<br>      Nothing -> ...<br>
      Just r -> ...<br><br></div><div class="gmail_extra">Nevertheless, upward and onward to an even finer imperative language!<br></div><div class="gmail_extra"><br clear="all"></div><div class="gmail_extra"><div>-- Kim-Ee</div>


</div></div>