RosettaCodeData/Task/Inverted-syntax/Haskell/inverted-syntax-1.hs

3 lines
106 B
Haskell
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
when :: Monad m => m () -> Bool -> m ()
action `when` condition = if condition then action else return ()