[Haskell-cafe] Fwd: extending Do notation
silvio
silvio.frischi at gmail.com
Tue May 20 18:01:31 UTC 2014
> do ...
> if <- checkCondition
> then doReportSuccess
> else doReportFailure
>
> as well as
>
> do ...
> case <- generateResult of
> Nothing -> ...
> Just r -> ...
>
> instead of
>
> do ...
> b <- checkCondition
> if b ...
>
> and
>
> do ...
> r <- generateResult
> case r of ...
We could call it (<- exp) instead of ({ exp }) if that makes everyone
feel more confortable but I don't see a reason to restrict it to if and
case. It can could go into any expression.
silvio
More information about the Haskell-Cafe
mailing list