[Haskell-beginners] Early return in IO monad

Tony Morris tmorris at tmorris.net
Sun Sep 1 03:16:20 CEST 2013


unless somePreCondition ...
 On 01/09/2013 4:07 AM, "Nathan Hüsken" <nathan.huesken at posteo.de> wrote:

> Hey,
>
> Is it somehow possible to return "early" in a do block of the IO monad?
> The eqivalent do in C:
>
> void doBlock() {
>     if (some preCondition) {
>       return;
>     }
>     ...
> }
>
> ???
>
> Thanks!
> Nathan
>
> ______________________________**_________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/**mailman/listinfo/beginners<http://www.haskell.org/mailman/listinfo/beginners>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130901/f0d523c4/attachment.htm>


More information about the Beginners mailing list