module ControlMaybe where withJust (Just x) f = f x withJust Nothing f = return () whenJust acn f = do x <- acn withJust x f