import Control.Monad ( guard ) do a <- [ 1 .. 4 ] b <- [ 2 .. 3 ] guard $ even (a + b) return ( a * b )Definition:
guard f = if f then return () else mzeroWirkung:
guard f >>= \ () -> m = if f then m else mzerokonkrete Implementierung:
class Monad m => MonadPlus m where mzero :: m a ; ... instance MonadPlus [] where mzero = []